Skip to content

Commit

Permalink
Fix --stdin-to-clipboard
Browse files Browse the repository at this point in the history
With the switch to esm, this require is now failing.  fs is already
imported, so we can just use it anyway.

Fixes #7056.
  • Loading branch information
code-asher committed Oct 31, 2024
1 parent f248926 commit b8ef4e3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions patches/clipboard.diff
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ Index: code-server/lib/vscode/src/vs/server/node/server.cli.ts
return true;
default:
return false;
@@ -293,6 +294,23 @@ export async function main(desc: Product
@@ -293,6 +294,22 @@ export async function main(desc: Product
}
}
} else {
Expand All @@ -119,7 +119,6 @@ Index: code-server/lib/vscode/src/vs/server/node/server.cli.ts
+ console.error("stdin has a tty.");
+ return;
+ }
+ const fs = require("fs");
+ const stdinBuffer = fs.readFileSync(0); // STDIN_FILENO = 0
+ const clipboardContent = stdinBuffer.toString();
+ sendToPipe({
Expand Down

0 comments on commit b8ef4e3

Please sign in to comment.