claude-code - 💡(How to fix) Fix Ctrl-G external editor spawn regression introduced between 2.1.132 and 2.1.138 (Windows + Cygwin/MSYS2) [2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#58664Fetched 2026-05-14 03:42:34
View on GitHub
Comments
2
Participants
2
Timeline
7
Reactions
0
Timeline (top)
labeled ×5commented ×2

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.

Error Message

Error Messages/Logs

Root Cause

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.

Fix Action

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.

RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • 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

  1. Set EDITOR=vim (or $VISUAL=vim).
  2. Start claude in a terminal.
  3. 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) → works
    • 2.1.138 (2026-05-11) → broken
    • 2.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

  1. Set EDITOR=vim (or $VISUAL=vim).
  2. Start claude in a mintty terminal.
  3. 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

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING