Skip to content

Commit

Permalink
handle multiline pastes
Browse files Browse the repository at this point in the history
  • Loading branch information
balins committed Feb 10, 2025
1 parent 4f2828f commit 13bb459
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/vscode-extension/src/devices/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,7 @@ export class Preview implements Disposable {
}

public sendClipboard(text: string) {
// This is bad, but prevents simulator server going crazy with multiline pastes
// If we want to support multiline pastes we need to change the communication protocol
this.subprocess?.stdin?.write(`paste ${text.replace(/(?:\r\n|\r|\n)/g, " ")}\n`);
// We use markers for start and end of the paste to handle multi-line pastes
this.subprocess?.stdin?.write(`paste >>>START-SIMSERVER-PASTE${text}<<<END-SIMSERVER-PASTE\n`);
}
}

0 comments on commit 13bb459

Please sign in to comment.