Ctrl-G external editor spawn regression introduced between 2.1.132 and 2.1.138 (Windows + Cygwin/MSYS2)
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?
Ctrl-G external editor spawn regression introduced between 2.1.132 and 2.1.138
Summary
Pressing Ctrl-G to open the external $EDITOR causes the Claude Code TUI
to hang ("spinner of death") in Claude Code 2.1.138 and 2.1.140.
The same workflow worked correctly in 2.1.132.
This is a regression confirmed by version bisection on a single machine
with no other environment changes.
Reproduction
- Set
EDITOR=vim(or$VISUAL=vim). - Start
claudein a terminal. - Press Ctrl-G to open the external editor.
Expected: vim opens in the current terminal, accepts input, exits cleanly,
control returns to Claude Code with the edited prompt.
Actual (2.1.138 / 2.1.140): TUI freezes with the spinner; vim never
becomes interactive. Killing the editor process is required to recover.
Environment
- OS: Windows 11 Enterprise 22H2 (Build 22631)
- Shell / Terminal: Reproduced in two independent setups:
- Cygwin 3.6.x + tmux + mintty (primary working environment)
- Git for Windows 2.54.0 (MSYS2) + mintty (secondary, used for cross-check)
- Editor: vim 9.1 (Git for Windows MSYS2 build); also reproduced with
Cygwin's vim. Editor binary itself works correctly when invoked directly
in the shell — the issue is the spawn from Claude Code.
- Claude Code versions on the same machine (binaries in
~/.local/share/claude/versions/):
2.1.132(2026-05-07) → works2.1.138(2026-05-11) → broken2.1.140(2026-05-13) → broken
What I ruled out
- Cygwin runtime as cause: repro also occurs under Git for Windows
MSYS2 (different POSIX emulation, no cygwin1.dll); confirmed via
uname -a and ldd of the editor binary.
- vim configuration: repro persists with
vim -u NONE -N. - Outdated Git for Windows: repro persists after updating from
2.53.0.windows.1 to 2.54.0.windows.1.
- mintty pty issues alone: Claude Code 2.1.132 spawns vim cleanly in
the exact same mintty session, so the host terminal is not the cause.
Workaround
A winpty-based wrapper script (winpty vim "$@") makes vim spawn at all
under 2.1.138/2.1.140, but causes input-handling issues in insert mode
(ESC inserts garbage instead of leaving insert mode). The only clean
workaround currently is to stay on 2.1.132.
Likely related issues
- #9218 (Fedora 42 + vim/nano — similar Ctrl-G symptom, no version bisection)
- #36516 (Ctrl-G suspends TUI)
- #27001 (Ctrl-G with kitty keyboard protocol)
Useful next step for triage
Diffing the editor-spawn / pty-handover logic between 2.1.132 and 2.1.138
should isolate the offending change.
What Should Happen?
Behaviour of editor spawn should behave exactly as in Version 2.1.132
Error Messages/Logs
Steps to Reproduce
- Set
EDITOR=vim(or$VISUAL=vim). - Start
claudein a mintty terminal. - Press Ctrl-G to open the external editor.
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
2.1.132
Claude Code Version
2.1.140
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Other
Additional Information
_No response_
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗