Skip to content

suffix leaks into process name on macOS/Linux, visible in tmux window titles #28639

@tim-hilde

Description

@tim-hilde

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

  1. Install opencode v1.15.5 via brew
  2. Run opencode in a tmux pane with automatic-rename enabled
  3. 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)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions