[BUG] "edit in nvim" breaks terminal rendering
Status Fixed / completed
Maintainer reply None cached
Workaround ✓ Mentioned in thread ↓
Activity 15 comments · opened Oct 8, 2025 · closed Dec 10, 2025
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
With the new feature "edit prompt in nvim" (ctrl+g), on macOS, doing that breaks tui if a window is opened, and then an up arrow is pressed, or while Claude is working. This shows the regular claude window, and vim at the same time, alternating each frame. This leads to all kinds of jank:
<img width="1609" height="885" alt="Image" src="https://github.com/user-attachments/assets/07042ce5-2617-4d49-9580-2924ef024e78" />
I'm using Ghostty on MacOS, and nvim 0.11.4 as my editor.
What Should Happen?
no glitches
Error Messages/Logs
Steps to Reproduce
Included above
Claude Model
Not sure / Multiple models
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
2.0.10
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Other
Additional Information
_No response_
15 Comments
Found 1 possible duplicate issue:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
having the same issue; thought it was vim plugins causing the issue so i disabled everything and just made it vanilla... same issue.
running macOS Tahoe, claude code v 2.0.10 with native install, Ghostty terminal
Also see this issue with:
Environment
Behavior
In the vim case the terminal becomes unresponsive and I cannot return claude, have to close terminal window. With nano, I can exit nano but the text is not picked up by claude.
Additional Context
This appears to be an issue with how Claude Code is:
Launching the external editor process
Capturing/restoring terminal state before/after editor invocation
Handling the terminal escape sequences for the editor session
The consistency across multiple terminal emulators suggests the issue is in Claude Code's terminal state management rather than terminal-specific behavior.
Also happens with terminal emacs and iTerm2. I'm not even sure how it's possible but the terminal state got so borked that even exiting to bash and typing
resetdid not fix it. I had to completely restart a new terminal.I'm using this workaround which opens a Neovim instance in a tmux popup if in a tmux session, else it opens neovim in a new foot terminal. I've got this simple script in
~/local/bin/claude-editor.sh:And then I put this into
~/.claude/settings.json:Also happens with NVIM v0.11.3, iTerm2 3.6.4 and Claude Code 2.0.14
Also happens when hitting crtl-g to edit in vscode. It breaks the Claude instance and I am left with a black screen and cannot return to Claude Code anymore.
This is a good work around, and I think I need it anyway to customise the floating pane. Although I found you need to set both
EDITORandVISUAL:Also want to share my editor script, maybe useful:
Update: kitty launch doesn't block. So when it exits immediately, claude removes the temp file so there was nothing to be edited. The correct one should be:
And there was a bug in
--wait-for-child-to-exitand fixed in https://github.com/kovidgoyal/kitty/pull/9165My experience is claude will prioritize
VISUALoverEDITOR. You only need to set one, but if you haveVISUALset to e.g.nvimin your shell environment, it won't do to set justEDITORinsettings.json.---
And thank you @jakubbortlik! I quickly found I often want to minimize the popup in order to gather context for the prompt I'm writing, so I went a little off the rails and turned it into a stateful popup that can be toggled and resurfaced across different tmux windows. Source
Thanks. I started with just
EDITOR, it just didn't work for me, maybe I already haveVISUALin the parent env... So, to be on the safe side, I set both.This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
Don't close this issue. This is an automatic message by Fresh - a bot against stale bots.
@Nek-12 I know that the "stale bots" can be annoying, but if you had checked, you would've found out that this issue is actually resolved in recent versions of Claude Code, hence keeping the issue open adds unnecessary work for the developers. In a repo with over 5 thousand open issues this is not helping.
@jakubbortlik If the bug has been fixed, then the issue should've been closed by maintainers. I'm not responsible for 5000 issues opened, I opened an issue on a legitimate bug. thanks.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.