Description
The /editor command (ctrl+x e) does not open $EDITOR when using opencode attach to connect to a remote opencode serve instance. It works correctly when running opencode directly (single-process mode, including over SSH with a TTY).
Setup:
- Remote:
opencode serve --port 4096 running on a Linux server
- Tunnel:
ssh -L 4096:127.0.0.1:4096 <remote>
- Local:
opencode attach http://localhost:4096 (macOS, iTerm2)
When pressing ctrl+x e, the TUI briefly flickers (suggesting it receives and attempts to handle the command) but no editor opens. The TUI renders and functions normally otherwise (sessions, prompts, model responses all work).
Note: /editor works fine when running opencode directly on the same remote machine over SSH (ssh -t <remote> opencode), confirming the issue is specific to the attach client/server split.
Expected: The attach client should spawn $EDITOR locally (on the client machine) using the /tui/control/next → /tui/control/response mechanism, since the TUI is running on the local machine and has access to a TTY.
Context: The opencode attach architecture runs the TUI client locally while the server runs remotely. The server cannot spawn an editor process (no TTY attached), but the local client can and should handle this via the existing control request API.
Plugins
None
OpenCode version
1.15.13
Steps to reproduce
- Start
opencode serve --port 4096 on a remote machine
- Forward port:
ssh -L 4096:127.0.0.1:4096 <remote>
- Run
opencode attach http://localhost:4096 locally
- Press
ctrl+x e (or type /editor)
- TUI briefly flickers but no editor opens
- Compare:
ssh -t <remote> 'cd /project && opencode' then ctrl+x e — editor opens correctly
Screenshot and/or share link
N/A
Operating System
macOS (client), Linux (server)
Terminal
iTerm2
Description
The
/editorcommand (ctrl+x e) does not open$EDITORwhen usingopencode attachto connect to a remoteopencode serveinstance. It works correctly when runningopencodedirectly (single-process mode, including over SSH with a TTY).Setup:
opencode serve --port 4096running on a Linux serverssh -L 4096:127.0.0.1:4096 <remote>opencode attach http://localhost:4096(macOS, iTerm2)When pressing
ctrl+x e, the TUI briefly flickers (suggesting it receives and attempts to handle the command) but no editor opens. The TUI renders and functions normally otherwise (sessions, prompts, model responses all work).Note:
/editorworks fine when runningopencodedirectly on the same remote machine over SSH (ssh -t <remote> opencode), confirming the issue is specific to the attach client/server split.Expected: The
attachclient should spawn$EDITORlocally (on the client machine) using the/tui/control/next→/tui/control/responsemechanism, since the TUI is running on the local machine and has access to a TTY.Context: The
opencode attacharchitecture runs the TUI client locally while the server runs remotely. The server cannot spawn an editor process (no TTY attached), but the local client can and should handle this via the existing control request API.Plugins
None
OpenCode version
1.15.13
Steps to reproduce
opencode serve --port 4096on a remote machinessh -L 4096:127.0.0.1:4096 <remote>opencode attach http://localhost:4096locallyctrl+x e(or type/editor)ssh -t <remote> 'cd /project && opencode'thenctrl+x e— editor opens correctlyScreenshot and/or share link
N/A
Operating System
macOS (client), Linux (server)
Terminal
iTerm2