Description
When running opencode manually in VS Code's integrated terminal (typing opencode directly, not via the extension's Cmd+Esc launcher), the terminal tab stays named "zsh" instead of being renamed to "opencode". This prevents the Cmd+Option+K file reference hotkey from working because the extension identifies opencode terminals by checking terminal.name === "opencode" (see sdks/vscode/src/extension.ts:35).
Root cause
The bin/opencode entry point is a Node.js wrapper (#!/usr/bin/env node) that uses child_process.spawn() to launch the compiled opencode binary as a child process, keeping the node wrapper alive as a signal forwarder:
zsh → node (wrapper) → opencode (compiled binary)
VS Code's terminal process detection reads the binary filename from the OS process table (via ps/kern_proc). It sees the direct child of zsh as node, not opencode. Since the compiled binary is a grandchild, VS Code never detects it.
This is the same underlying issue as #10993 — Cmd+Option+K fails because the extension checks terminal.name === TERMINAL_NAME and the name never becomes "opencode".
Proposed fix
Replace the Node.js wrapper with a POSIX shell script that execs directly into the compiled binary. On Unix, exec replaces the calling process with the target binary, so the OS process table shows opencode as the direct child of zsh:
zsh → opencode (compiled binary, via exec)
The change is:
bin/opencode becomes a ~25-line POSIX shell script that resolves the binary path and execs into it
bin/opencode-resolve (new) — the existing Node.js detection logic (platform/AVX2/musl), outputs the resolved binary path to stdout instead of spawning+forwarding signals
bin/opencode.cmd (new) — Windows fallback using the Node.js resolver
I have this working locally — confirmed that running the compiled binary directly renames the VS Code terminal tab to "opencode", and Cmd+Option+K works as expected.
Plugins
Official OpenCode Extension
Steps to reproduce
- Open VS Code integrated terminal (Ctrl+`)
- Type
opencode (do NOT use Cmd+Esc)
- Observe terminal tab stays "zsh"
- Open a file, highlight a line, press
Cmd+Option+K
- Nothing happens — file reference is not sent to the terminal
Operating System
macOS 26.2
Terminal
VS Code Integrated Terminal
Description
When running
opencodemanually in VS Code's integrated terminal (typingopencodedirectly, not via the extension'sCmd+Esclauncher), the terminal tab stays named "zsh" instead of being renamed to "opencode". This prevents theCmd+Option+Kfile reference hotkey from working because the extension identifies opencode terminals by checkingterminal.name === "opencode"(seesdks/vscode/src/extension.ts:35).Root cause
The
bin/opencodeentry point is a Node.js wrapper (#!/usr/bin/env node) that useschild_process.spawn()to launch the compiledopencodebinary as a child process, keeping thenodewrapper alive as a signal forwarder:VS Code's terminal process detection reads the binary filename from the OS process table (via
ps/kern_proc). It sees the direct child ofzshasnode, notopencode. Since the compiled binary is a grandchild, VS Code never detects it.This is the same underlying issue as #10993 —
Cmd+Option+Kfails because the extension checksterminal.name === TERMINAL_NAMEand the name never becomes "opencode".Proposed fix
Replace the Node.js wrapper with a POSIX shell script that
execs directly into the compiled binary. On Unix,execreplaces the calling process with the target binary, so the OS process table showsopencodeas the direct child ofzsh:The change is:
bin/opencodebecomes a ~25-line POSIX shell script that resolves the binary path andexecs into itbin/opencode-resolve(new) — the existing Node.js detection logic (platform/AVX2/musl), outputs the resolved binary path to stdout instead of spawning+forwarding signalsbin/opencode.cmd(new) — Windows fallback using the Node.js resolverI have this working locally — confirmed that running the compiled binary directly renames the VS Code terminal tab to "opencode", and
Cmd+Option+Kworks as expected.Plugins
Official OpenCode Extension
Steps to reproduce
opencode(do NOT useCmd+Esc)Cmd+Option+KOperating System
macOS 26.2
Terminal
VS Code Integrated Terminal