Description
Since v1.15.5 (PR #27801), the npm package ships its binary as bin/opencode.exe. On macOS and Linux, this .exe suffix propagates through the npm bin symlink chain and ends up as the process name reported by the OS. This is visible in:
- tmux window titles (via
automatic-rename-format using #{pane_current_command})
- Any tool that reads the process name from
/proc/<pid>/comm or proc_name()
Chain on macOS (brew install):
/opt/homebrew/bin/opencode
→ Cellar/opencode/1.15.5/bin/opencode
→ libexec/bin/opencode
→ lib/node_modules/opencode-ai/bin/opencode.exe ← actual bun-compiled binary
tmux resolves the final binary path via proc_pidpath() → basename is opencode.exe, so #{pane_current_command} displays opencode.exe.
Steps to reproduce
- Install opencode v1.15.5 via brew
- Run opencode in a tmux pane with
automatic-rename enabled
- Observe the tmux window title shows
opencode.exe instead of opencode
Proposed fix
In postinstall.mjs, make targetBinary platform-aware so the .exe suffix is only used on Windows:
-const targetBinary = path.join(__dirname, "bin", "opencode.exe")
+const targetBinary = path.join(
+ __dirname,
+ "bin",
+ platform === "windows" ? "opencode.exe" : "opencode"
+)
The package.json bin field generation would also need a corresponding change to point to bin/opencode on non-Windows platforms.
Version
opencode v1.15.5
Operating System
macOS (affects all non-Windows platforms)
Terminal
tmux (any terminal using tmux automatic-rename)
Description
Since v1.15.5 (PR #27801), the npm package ships its binary as
bin/opencode.exe. On macOS and Linux, this.exesuffix propagates through the npmbinsymlink chain and ends up as the process name reported by the OS. This is visible in:automatic-rename-formatusing#{pane_current_command})/proc/<pid>/commorproc_name()Chain on macOS (brew install):
tmux resolves the final binary path via
proc_pidpath()→ basename isopencode.exe, so#{pane_current_command}displaysopencode.exe.Steps to reproduce
automatic-renameenabledopencode.exeinstead ofopencodeProposed fix
In
postinstall.mjs, maketargetBinaryplatform-aware so the.exesuffix is only used on Windows:The package.json
binfield generation would also need a corresponding change to point tobin/opencodeon non-Windows platforms.Version
opencode v1.15.5
Operating System
macOS (affects all non-Windows platforms)
Terminal
tmux (any terminal using tmux automatic-rename)