[BUG] /editor command fails silently when using neovim-remote in Neovim terminal #854

Closed
opened 2026-02-16 17:28:34 -05:00 by yindo · 3 comments
Owner

Originally created by @vinicius507 on GitHub (Jul 22, 2025).

Originally assigned to: @adamdotdevin on GitHub.

Description:
When running OpenCode within a Neovim terminal session and having the EDITOR environment variable configured to use neovim-remote (nvr), attempting to use the /editor command results in silent failure. The command appears to execute but no buffer/editor instance opens, and no error message is displayed to indicate what went wrong.

Environment:

  • OpenCode version: 0.3.9
  • Neovim version: 0.11.2
  • Neovim Remote version: 2.5.1
  • Terminal: Neovim terminal (:terminal or similar)
  • Editor: EDITOR environment variable set to neovim-remote (nvr)
  • Platform: MacOS/Linux

Expected Behavior:
The /editor command should either:

  1. Successfully open the file in the existing Neovim instance via neovim-remote, or
  2. Display a clear error message explaining why it cannot open the editor

Actual Behavior:
The /editor command fails silently with no feedback to the user about what went wrong.

Steps to Reproduce:

  1. Set EDITOR environment variable to neovim-remote (e.g., export EDITOR=nvr --servername SERVER_NAME --remote-tab-wait +'setl bh=delete')
  2. Open Neovim
  3. Start a terminal session within Neovim (:terminal)
  4. Run OpenCode in the terminal
  5. Attempt to use the /editor command
  6. Observe that nothing happens and no error is reported

Workaround:
Spawn a neovim instance inside the existing one.

EDIT: Upon executing opencode with the --print-logs flags, I managed to see an error entry in the logs but it is obfuscated.

logs.txt

Originally created by @vinicius507 on GitHub (Jul 22, 2025). Originally assigned to: @adamdotdevin on GitHub. **Description:** When running OpenCode within a Neovim terminal session and having the `EDITOR` environment variable configured to use `neovim-remote` (`nvr`), attempting to use the `/editor` command results in silent failure. The command appears to execute but no buffer/editor instance opens, and no error message is displayed to indicate what went wrong. **Environment:** - OpenCode version: 0.3.9 - Neovim version: 0.11.2 - Neovim Remote version: 2.5.1 - Terminal: Neovim terminal (`:terminal` or similar) - Editor: `EDITOR` environment variable set to `neovim-remote` (nvr) - Platform: MacOS/Linux **Expected Behavior:** The `/editor` command should either: 1. Successfully open the file in the existing Neovim instance via neovim-remote, or 2. Display a clear error message explaining why it cannot open the editor **Actual Behavior:** The `/editor` command fails silently with no feedback to the user about what went wrong. **Steps to Reproduce:** 1. Set `EDITOR` environment variable to `neovim-remote` (e.g., `export EDITOR=nvr --servername SERVER_NAME --remote-tab-wait +'setl bh=delete'`) 2. Open Neovim 3. Start a terminal session within Neovim (`:terminal`) 4. Run OpenCode in the terminal 5. Attempt to use the `/editor` command 6. Observe that nothing happens and no error is reported **Workaround:** Spawn a neovim instance inside the existing one. **EDIT:** Upon executing opencode with the `--print-logs` flags, I managed to see an error entry in the logs but it is obfuscated. [logs.txt](https://github.com/user-attachments/files/21367158/logs.txt)
yindo closed this issue 2026-02-16 17:28:34 -05:00
Author
Owner

@brianhuster commented on GitHub (Aug 25, 2025):

I don't know why nvr doesn't work with OpenCode, but you can try using my plugin unnest.nvim, which just works with OpenCode /editor

@brianhuster commented on GitHub (Aug 25, 2025): I don't know why `nvr` doesn't work with OpenCode, but you can try using my plugin [unnest.nvim](https://github.com/brianhuster/unnest.nvim), which just works with OpenCode `/editor`
Author
Owner

@Hippo0o commented on GitHub (Sep 2, 2025):

@vinicius507 i found the issue to be caused by +'setl bh=delete'. The ' quotes get lost when the command is executed which causes nvr to error out and opencode can't handle it correctly.

The way i solved it was defining a seperate command that sets the bufhidden option so that you don't need a space and quotes with the nvr command.

@brianhuster i like your plugin as an alternative. My tip is using it with $EDITOR="nvim --headless" for opencode.

@Hippo0o commented on GitHub (Sep 2, 2025): @vinicius507 i found the issue to be caused by `+'setl bh=delete'`. The `'` quotes get lost when the command is executed which causes nvr to error out and opencode can't handle it correctly. The way i solved it was defining a seperate command that sets the bufhidden option so that you don't need a space and quotes with the nvr command. @brianhuster i like your plugin as an alternative. My tip is using it with `$EDITOR="nvim --headless"` for opencode.
Author
Owner

@rekram1-node commented on GitHub (Dec 27, 2025):

[automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!

@rekram1-node commented on GitHub (Dec 27, 2025): [automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#854