Skip to content

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

Closed

Description

@vinicius507

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

Activity

  1. brianhuster commented on Aug 25, 2025

    @brianhuster

    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

  2. Hippo0o commented on Sep 2, 2025

    @Hippo0o

    @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.

  3. rekram1-node commented on Dec 28, 2025

    @rekram1-node
    Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions