Skip to content

EDITOR=nvim hangs & some characters seem to pass to the opencode instead of nvim #4209

Closed
anomalyco/opentui
#331

Description

@Pivert

Description

Using opencode v1.0.57, and
export EDITOR=/usr/local/bin/nvim (nvim 0.11.2)

When I switch to nvim editor (+x e)

The vim editor seems to grab less than half of the key stroke / hangs...

When we can finally type the :q! in the nvim editor, we can see that some characters were inserted in the opencode UI such as ":q!::::qqqqq" (the number of tries we had to type to finally exit nvim)

It seems both foreground nvim and background opencode fight to get the keyboard.

The problem does not occur with old v0.5.13 but seems to occur from version 1.0.0.

OpenCode version

v1.0.57

Steps to reproduce

  1. switch to nvim editor (+x e)
  2. try to edit or enter some text
  3. The nvim freezes every second or so. It gets difficult even to quit it (:q!)

Screenshot and/or share link

No response

Operating System

Kubuntu 24.04 LTS

Terminal

Konsole

Activity

  1. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Nov 11, 2025
  2. github-actions commented on Nov 11, 2025

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    Feel free to ignore if none of these address your specific case.

  3. Pivert commented on Nov 11, 2025

    @Pivert
    Author

    So far, I did try:

    • Downgrade opencode to 0.5.13 => It fixes the problem OK
    • Using vim : export EDITOR=/usr/bin/vim.nox => NOK
    • Changing TERM to xterm => NOK
    • Removing the $HOME/.config/nvim to reset the nvim profile => NOK
    • Using another terminal than konsole such as kitty => NOK
  4. lennox-davidlevy commented on Nov 20, 2025

    @lennox-davidlevy

    I am experiencing this same issue on v1.0.80.

    After entering editor mode via /editor, input is erratic. Keystrokes are frequently missed or require multiple presses to register (behaving like a race condition on stdin), making the editor unusable until I kill the process.

    Environment:

    • OS: Linux Fedora 42
    • Terminal: Ghostty 1.2.3-1.fc42
    • Neovim: v0.12.0-dev+1665-69b286c3b
  5. fnumatic commented on Nov 20, 2025

    @fnumatic

    Same issue on version 1.0.80

    I'm encountering the exact same problem as described in the original issue, still present in v1.0.80.

    Description

    After entering editor mode using the /editor command, keyboard input becomes extremely erratic:

    • Many keystrokes are completely ignored
    • Some keys require multiple presses (sometimes 3–10 times) before they register

    Environment

    • OS: Ubuntu 25.10 (Questing Quokka)
    • Terminal: Ptyxis 49.1 (GNOME terminal emulator)
    • Affected editors:
      • Neovim: NVIM v0.11.5 → Not working
      • Vim: VIM - Vi IMproved 9.1 → Not working
      • nano: GNU nano 8.4 → Works perfectly
  6. gabrielmontagne commented on Nov 20, 2025

    @gabrielmontagne

    I have the same issue with plain VIM (8.2 and 9.0); noticied it today running OC 1.0.80.

    If I rollback just to 1.0.77 it seems to work ok for me.

  7. lennox-davidlevy commented on Nov 20, 2025

    @lennox-davidlevy

    @gabrielmontagne I can confirm, rolling back to 1.0.77 is working for me as well.

  8. fnumatic commented on Nov 20, 2025

    @fnumatic

    for me v1.0.78 is the last good version
    v1.0.79 starts to fail

    probably:
    9c85a37

  9. bowmanjd commented on Nov 21, 2025

    @bowmanjd

    @veracioux may have the right idea to fix this in opentui, but I also offer #4595 in the theory that it is a good idea to turn off raw mode for the duration of the editor session. In other words, give the editor the keyboard input. (Edit: After further testing, I closed that PR, as it was not effective after all. The issue on my machine came and went, causing me to think this had fixed it when in fact it did not.)

  10. the-coding-doggo commented on Nov 21, 2025

    @the-coding-doggo

    Same issue on version 1.0.85

    I'm encountering the exact same problem as described in the original issue, still present in v1.0.80.

    Description
    After entering editor mode using the /editor command, keyboard input becomes extremely erratic:
    Many keystrokes are completely ignored, then after closing edior TUI crashes
    Some keys require multiple presses (sometimes 3–10 times) before they register

    Environment
    OS: 6.17.8-arch1-1 -- Hyprland
    Terminal: foot
    Affected editors:
    Neovim: NVIM v0.11.5 → Not working

    Temporary fix
    export EDITOR="foot -e nvim" --> It opens nvim in a different terminal and reopens the tui at terminal close

  11. hamidi-dev commented on Nov 23, 2025

    @hamidi-dev

    same issue here on MacOS + Iterm2 + tmux. And in Ubuntu WSL + tmux.
    I am now also stuck on 1.0.78, the last "good" version

  12. bowmanjd commented on Nov 23, 2025

    @bowmanjd

    Temporary fix export EDITOR="foot -e nvim" --> It opens nvim in a different terminal and reopens the tui at terminal close

    @hamidi-dev and others, don't forget the good workaround from @the-coding-doggo -- if you set VISUAL or EDITOR to a terminal command that launches your editor, the experience is pretty smooth.

    That is, just while we wait a short while for a fix to land... The PR from @veracioux was merged into opentui yesterday and is available in opentui 0.1.49. So, once opencode is using opentui 0.1.49, all will be well.

    For the impatient, bun add @opentui/core@0.1.49 @opentui/solid@0.1.49 in the packages/opencode directory works wonders.

  13. kommander commented on Nov 23, 2025

    @kommander
    Contributor

    Is live now with 1.0.106, better?

  14. bowmanjd commented on Nov 23, 2025

    @bowmanjd

    Yes, all better now! Thank you so much.

  15. fnumatic commented on Nov 24, 2025

    @fnumatic

    v1.0.106 fixed, thank you

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingopentuiThis relates to changes in v1.0, now that opencode uses opentui

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions