summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDax Raad <[email protected]>2025-12-21 18:33:34 -0500
committerDax Raad <[email protected]>2025-12-21 18:33:37 -0500
commitc333ffa38bc6fffd6d2cc7b89f4990074a49a522 (patch)
tree2cab01aaaae3ab32cb3b2fe3489812398e727815
parent3456f4ed8053f7718865d2d03dc261e983fed9aa (diff)
downloadopencode-c333ffa38bc6fffd6d2cc7b89f4990074a49a522.tar.gz
opencode-c333ffa38bc6fffd6d2cc7b89f4990074a49a522.zip
core: fix LSP server binary installation and shell command execution
- Ensure proper file permissions are set for installed LSP binaries on non-Windows platforms - Add error handling for shell command execution in prompt system to prevent crashes
-rw-r--r--packages/opencode/src/lsp/server.ts14
-rw-r--r--packages/opencode/src/session/prompt.ts2
2 files changed, 8 insertions, 8 deletions
diff --git a/packages/opencode/src/lsp/server.ts b/packages/opencode/src/lsp/server.ts
index 4db0e7237..0551808ac 100644
--- a/packages/opencode/src/lsp/server.ts
+++ b/packages/opencode/src/lsp/server.ts
@@ -697,7 +697,7 @@ export namespace LSPServer {
})
if (!ok) return
} else {
- await $`tar -xf ${tempPath}`.cwd(Global.Path.bin).nothrow()
+ await $`tar -xf ${tempPath}`.cwd(Global.Path.bin).quiet().nothrow()
}
await fs.rm(tempPath, { force: true })
@@ -710,7 +710,7 @@ export namespace LSPServer {
}
if (platform !== "win32") {
- await $`chmod +x ${bin}`.nothrow()
+ await $`chmod +x ${bin}`.quiet().nothrow()
}
log.info(`installed zls`, { bin })
@@ -1003,7 +1003,7 @@ export namespace LSPServer {
if (!ok) return
}
if (tar) {
- await $`tar -xf ${archive}`.cwd(Global.Path.bin).nothrow()
+ await $`tar -xf ${archive}`.cwd(Global.Path.bin).quiet().nothrow()
}
await fs.rm(archive, { force: true })
@@ -1014,7 +1014,7 @@ export namespace LSPServer {
}
if (platform !== "win32") {
- await $`chmod +x ${bin}`.nothrow()
+ await $`chmod +x ${bin}`.quiet().nothrow()
}
await fs.unlink(path.join(Global.Path.bin, "clangd")).catch(() => {})
@@ -1580,7 +1580,7 @@ export namespace LSPServer {
}
if (platform !== "win32") {
- await $`chmod +x ${bin}`.nothrow()
+ await $`chmod +x ${bin}`.quiet().nothrow()
}
log.info(`installed terraform-ls`, { bin })
@@ -1663,7 +1663,7 @@ export namespace LSPServer {
if (!ok) return
}
if (ext === "tar.gz") {
- await $`tar -xzf ${tempPath}`.cwd(Global.Path.bin).nothrow()
+ await $`tar -xzf ${tempPath}`.cwd(Global.Path.bin).quiet().nothrow()
}
await fs.rm(tempPath, { force: true })
@@ -1676,7 +1676,7 @@ export namespace LSPServer {
}
if (platform !== "win32") {
- await $`chmod +x ${bin}`.nothrow()
+ await $`chmod +x ${bin}`.quiet().nothrow()
}
log.info("installed texlab", { bin })
diff --git a/packages/opencode/src/session/prompt.ts b/packages/opencode/src/session/prompt.ts
index ebd54a6c8..748851b4f 100644
--- a/packages/opencode/src/session/prompt.ts
+++ b/packages/opencode/src/session/prompt.ts
@@ -1309,7 +1309,7 @@ export namespace SessionPrompt {
const results = await Promise.all(
shell.map(async ([, cmd]) => {
try {
- return await $`${{ raw: cmd }}`.nothrow().text()
+ return await $`${{ raw: cmd }}`.quiet().nothrow().text()
} catch (error) {
return `Error executing command: ${error instanceof Error ? error.message : String(error)}`
}