Fix --stdin-to-clipboard

With the switch to esm, this require is now failing.  fs is already
imported, so we can just use it anyway.

Fixes #7056.
This commit is contained in:
Asher 2024-10-31 15:29:53 -08:00
parent f2489265d2
commit b8ef4e3edc
No known key found for this signature in database
GPG Key ID: D63C1EF81242354A
1 changed files with 1 additions and 2 deletions

View File

@ -110,7 +110,7 @@ Index: code-server/lib/vscode/src/vs/server/node/server.cli.ts
return true; return true;
default: default:
return false; return false;
@@ -293,6 +294,23 @@ export async function main(desc: Product @@ -293,6 +294,22 @@ export async function main(desc: Product
} }
} }
} else { } else {
@ -119,7 +119,6 @@ Index: code-server/lib/vscode/src/vs/server/node/server.cli.ts
+ console.error("stdin has a tty."); + console.error("stdin has a tty.");
+ return; + return;
+ } + }
+ const fs = require("fs");
+ const stdinBuffer = fs.readFileSync(0); // STDIN_FILENO = 0 + const stdinBuffer = fs.readFileSync(0); // STDIN_FILENO = 0
+ const clipboardContent = stdinBuffer.toString(); + const clipboardContent = stdinBuffer.toString();
+ sendToPipe({ + sendToPipe({