From b8ef4e3edc70aa78f1ba8fcc42b9d9858ea3ecb8 Mon Sep 17 00:00:00 2001 From: Asher Date: Thu, 31 Oct 2024 15:29:53 -0800 Subject: [PATCH] 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. --- patches/clipboard.diff | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/patches/clipboard.diff b/patches/clipboard.diff index a7a0a4c0f..84d6c8f84 100644 --- a/patches/clipboard.diff +++ b/patches/clipboard.diff @@ -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 { @@ -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({