diff --git a/packages/opencode/src/lsp/index.ts b/packages/opencode/src/lsp/index.ts index 2eb1ad93e986..c0a034785dc9 100644 --- a/packages/opencode/src/lsp/index.ts +++ b/packages/opencode/src/lsp/index.ts @@ -119,6 +119,7 @@ export namespace LSP { ...process.env, ...item.env, }, + stdio: ["pipe", "pipe", "ignore"], }), initialization: item.initialization, } diff --git a/packages/opencode/src/lsp/server.ts b/packages/opencode/src/lsp/server.ts index 123e8aea8601..51588f76c4d9 100644 --- a/packages/opencode/src/lsp/server.ts +++ b/packages/opencode/src/lsp/server.ts @@ -1,4 +1,4 @@ -import type { ChildProcessWithoutNullStreams } from "child_process" +import { type ChildProcess } from "child_process" import path from "path" import os from "os" import { Global } from "../global" @@ -26,7 +26,7 @@ export namespace LSPServer { const output = (cmd: string[], opts: Process.RunOptions = {}) => Process.text(cmd, { ...opts, nothrow: true }) export interface Handle { - process: ChildProcessWithoutNullStreams + process: ChildProcess initialization?: Record } @@ -87,6 +87,7 @@ export namespace LSPServer { return { process: spawn(deno, ["lsp"], { cwd: root, + stdio: ["pipe", "pipe", "ignore"], }), } }, @@ -109,6 +110,7 @@ export namespace LSPServer { ...process.env, BUN_BE_BUN: "1", }, + stdio: ["pipe", "pipe", "ignore"], }) return { process: proc, @@ -160,6 +162,7 @@ export namespace LSPServer { ...process.env, BUN_BE_BUN: "1", }, + stdio: ["pipe", "pipe", "ignore"], }) return { process: proc, @@ -220,6 +223,7 @@ export namespace LSPServer { ...process.env, BUN_BE_BUN: "1", }, + stdio: ["pipe", "pipe", "ignore"], }) return { @@ -277,6 +281,7 @@ export namespace LSPServer { return { process: spawn(lintBin, ["--lsp"], { cwd: root, + stdio: ["pipe", "pipe", "ignore"], }), } } @@ -292,6 +297,7 @@ export namespace LSPServer { return { process: spawn(serverBin, [], { cwd: root, + stdio: ["pipe", "pipe", "ignore"], }), } } @@ -355,6 +361,7 @@ export namespace LSPServer { ...process.env, BUN_BE_BUN: "1", }, + stdio: ["pipe", "pipe", "ignore"], }) return { @@ -399,6 +406,7 @@ export namespace LSPServer { return { process: spawn(bin!, { cwd: root, + stdio: ["pipe", "pipe", "ignore"], }), } }, @@ -439,6 +447,7 @@ export namespace LSPServer { return { process: spawn(bin!, ["--lsp"], { cwd: root, + stdio: ["pipe", "pipe", "ignore"], }), } }, @@ -499,6 +508,7 @@ export namespace LSPServer { const proc = spawn(binary, ["server"], { cwd: root, + stdio: ["pipe", "pipe", "ignore"], }) return { @@ -554,6 +564,7 @@ export namespace LSPServer { ...process.env, BUN_BE_BUN: "1", }, + stdio: ["pipe", "pipe", "ignore"], }) return { process: proc, @@ -620,6 +631,7 @@ export namespace LSPServer { return { process: spawn(binary, { cwd: root, + stdio: ["pipe", "pipe", "ignore"], }), } }, @@ -732,6 +744,7 @@ export namespace LSPServer { return { process: spawn(bin, { cwd: root, + stdio: ["pipe", "pipe", "ignore"], }), } }, @@ -771,6 +784,7 @@ export namespace LSPServer { return { process: spawn(bin, { cwd: root, + stdio: ["pipe", "pipe", "ignore"], }), } }, @@ -810,6 +824,7 @@ export namespace LSPServer { return { process: spawn(bin, { cwd: root, + stdio: ["pipe", "pipe", "ignore"], }), } }, @@ -827,6 +842,7 @@ export namespace LSPServer { return { process: spawn(sourcekit, { cwd: root, + stdio: ["pipe", "pipe", "ignore"], }), } } @@ -844,6 +860,7 @@ export namespace LSPServer { return { process: spawn(bin, { cwd: root, + stdio: ["pipe", "pipe", "ignore"], }), } }, @@ -890,6 +907,7 @@ export namespace LSPServer { return { process: spawn(bin, { cwd: root, + stdio: ["pipe", "pipe", "ignore"], }), } }, @@ -906,6 +924,7 @@ export namespace LSPServer { return { process: spawn(fromPath, args, { cwd: root, + stdio: ["pipe", "pipe", "ignore"], }), } } @@ -916,6 +935,7 @@ export namespace LSPServer { return { process: spawn(direct, args, { cwd: root, + stdio: ["pipe", "pipe", "ignore"], }), } } @@ -929,6 +949,7 @@ export namespace LSPServer { return { process: spawn(candidate, args, { cwd: root, + stdio: ["pipe", "pipe", "ignore"], }), } } @@ -1036,6 +1057,7 @@ export namespace LSPServer { return { process: spawn(bin, args, { cwd: root, + stdio: ["pipe", "pipe", "ignore"], }), } }, @@ -1073,6 +1095,7 @@ export namespace LSPServer { ...process.env, BUN_BE_BUN: "1", }, + stdio: ["pipe", "pipe", "ignore"], }) return { process: proc, @@ -1120,6 +1143,7 @@ export namespace LSPServer { ...process.env, BUN_BE_BUN: "1", }, + stdio: ["pipe", "pipe", "ignore"], }) return { process: proc, @@ -1247,6 +1271,7 @@ export namespace LSPServer { ], { cwd: root, + stdio: ["pipe", "pipe", "ignore"], }, ), } @@ -1347,6 +1372,7 @@ export namespace LSPServer { return { process: spawn(launcherScript, ["--stdio"], { cwd: root, + stdio: ["pipe", "pipe", "ignore"], }), } }, @@ -1393,6 +1419,7 @@ export namespace LSPServer { ...process.env, BUN_BE_BUN: "1", }, + stdio: ["pipe", "pipe", "ignore"], }) return { process: proc, @@ -1538,6 +1565,7 @@ export namespace LSPServer { return { process: spawn(bin, { cwd: root, + stdio: ["pipe", "pipe", "ignore"], }), } }, @@ -1575,6 +1603,7 @@ export namespace LSPServer { ...process.env, BUN_BE_BUN: "1", }, + stdio: ["pipe", "pipe", "ignore"], }) return { process: proc, @@ -1600,6 +1629,7 @@ export namespace LSPServer { return { process: spawn(prisma, ["language-server"], { cwd: root, + stdio: ["pipe", "pipe", "ignore"], }), } }, @@ -1618,6 +1648,7 @@ export namespace LSPServer { return { process: spawn(dart, ["language-server", "--lsp"], { cwd: root, + stdio: ["pipe", "pipe", "ignore"], }), } }, @@ -1636,6 +1667,7 @@ export namespace LSPServer { return { process: spawn(bin, { cwd: root, + stdio: ["pipe", "pipe", "ignore"], }), } }, @@ -1672,6 +1704,7 @@ export namespace LSPServer { ...process.env, BUN_BE_BUN: "1", }, + stdio: ["pipe", "pipe", "ignore"], }) return { process: proc, @@ -1751,6 +1784,7 @@ export namespace LSPServer { return { process: spawn(bin, ["serve"], { cwd: root, + stdio: ["pipe", "pipe", "ignore"], }), initialization: { experimentalFeatures: { @@ -1847,6 +1881,7 @@ export namespace LSPServer { return { process: spawn(bin, { cwd: root, + stdio: ["pipe", "pipe", "ignore"], }), } }, @@ -1884,6 +1919,7 @@ export namespace LSPServer { ...process.env, BUN_BE_BUN: "1", }, + stdio: ["pipe", "pipe", "ignore"], }) return { process: proc, @@ -1904,6 +1940,7 @@ export namespace LSPServer { return { process: spawn(gleam, ["lsp"], { cwd: root, + stdio: ["pipe", "pipe", "ignore"], }), } }, @@ -1925,6 +1962,7 @@ export namespace LSPServer { return { process: spawn(bin, ["listen"], { cwd: root, + stdio: ["pipe", "pipe", "ignore"], }), } }, @@ -1956,6 +1994,7 @@ export namespace LSPServer { env: { ...process.env, }, + stdio: ["pipe", "pipe", "ignore"], }), } }, @@ -2050,7 +2089,7 @@ export namespace LSPServer { } return { - process: spawn(bin, { cwd: root }), + process: spawn(bin, { cwd: root, stdio: ["pipe", "pipe", "ignore"] }), } }, } @@ -2068,6 +2107,7 @@ export namespace LSPServer { return { process: spawn(bin, ["--lsp"], { cwd: root, + stdio: ["pipe", "pipe", "ignore"], }), } }, @@ -2086,6 +2126,7 @@ export namespace LSPServer { return { process: spawn(julia, ["--startup-file=no", "--history-file=no", "-e", "using LanguageServer; runserver()"], { cwd: root, + stdio: ["pipe", "pipe", "ignore"], }), } },