Description
The issue seems like is in the following lines
https://github.com/sst/opencode/blob/dev/packages/opencode/src/tool/bash.ts#L149-L154
Here - shell: true
**shell **- If true, runs command inside of a shell. Uses '/bin/sh' on Unix, and process.env.ComSpec on Windows. A different shell can be specified as a string.
I'm expecting from bash tools to execute at least bash, or default process.env.SHELL but sh feels pretty outdated for me.
Something like this feels more suitable (or check bash existance and use it if it exists in the PATH)
const defaultShell = process.platform === "win32"
? true // process.env.ComSpec on Windows
: process.env.SHELL ?? true // $SHELL - *default shell for new sessions* if set, otherwise /bun/sh
const proc = spawn(params.command, {
// use the user's login shell (or sensible fallback) rather than the system /bin/sh default
shell: defaultShell,
cwd: Instance.directory,
stdio: ["ignore", "pipe", "pipe"],
detached: process.platform !== "win32",
})
OpenCode version
0.15.18
Steps to reproduce
In opencode write following prompt
Run following bash command
pid=$$
echo "$(ps -p "$pid" -o comm=)"
The result is
/bin/sh on linux
Screenshot and/or share link
Share links doesn't work for me for unknown reason
Operating System
MacOs
Terminal
ITERM 2
Description
The issue seems like is in the following lines
https://github.com/sst/opencode/blob/dev/packages/opencode/src/tool/bash.ts#L149-L154
Here -
shell: trueI'm expecting from bash tools to execute at least bash, or default
process.env.SHELLbutshfeels pretty outdated for me.Something like this feels more suitable (or check bash existance and use it if it exists in the PATH)
OpenCode version
0.15.18
Steps to reproduce
In opencode write following prompt
Run following bash command
The result is
/bin/shon linuxScreenshot and/or share link
Share links doesn't work for me for unknown reason
Operating System
MacOs
Terminal
ITERM 2