Skip to content

/editor command (ctrl+x e) does not work in opencode attach mode #30582

@pcadena-lila

Description

@pcadena-lila

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

  1. Start opencode serve --port 4096 on a remote machine
  2. Forward port: ssh -L 4096:127.0.0.1:4096 <remote>
  3. Run opencode attach http://localhost:4096 locally
  4. Press ctrl+x e (or type /editor)
  5. TUI briefly flickers but no editor opens
  6. 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

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