fix(windows): use cross-spawn for shim-backed commands (#18010)

This commit is contained in:
Luke Parker
2026-03-19 08:49:16 +10:00
committed by GitHub
parent 8ee939c741
commit 54ed87d53c
11 changed files with 126 additions and 38 deletions
+3 -7
View File
@@ -1,4 +1,4 @@
import { spawn as launch, type ChildProcessWithoutNullStreams } from "child_process"
import type { ChildProcessWithoutNullStreams } from "child_process"
import path from "path"
import os from "os"
import { Global } from "../global"
@@ -13,11 +13,7 @@ import { Archive } from "../util/archive"
import { Process } from "../util/process"
import { which } from "../util/which"
import { Module } from "@opencode-ai/util/module"
const spawn = ((cmd, args, opts) => {
if (Array.isArray(args)) return launch(cmd, [...args], { ...(opts ?? {}), windowsHide: true })
return launch(cmd, { ...(args ?? {}), windowsHide: true })
}) as typeof launch
import { spawn } from "./launch"
export namespace LSPServer {
const log = Log.create({ service: "lsp.server" })
@@ -273,7 +269,7 @@ export namespace LSPServer {
}
if (lintBin) {
const proc = Process.spawn([lintBin, "--help"], { stdout: "pipe" })
const proc = spawn(lintBin, ["--help"])
await proc.exited
if (proc.stdout) {
const help = await text(proc.stdout)