Ctrl-G (Edit prompt in external editor) feature causes terminal corruption and unrecoverable state in v2.0.11

Resolved 💬 2 comments Opened Oct 9, 2025 by iq-mschmeets Closed Oct 9, 2025

Description

The new Ctrl-G feature introduced in version 2.0.11 to edit prompts in an external editor is causing severe terminal corruption and rendering the Claude Code session completely unrecoverable.

Version

  • Claude Code: 2.0.11

Environment

  • OS: Linux (Fedora 42, kernel 6.16.10-200.fc42.x86_64)
  • Terminal: Tested across multiple emulators with identical failures:
  • ghostty (with and without tmux)
  • gnome-terminal
  • tmux in ghostty
  • $TERM: xterm-256color
  • $EDITOR: vim (primary test), also tested with nano

Steps to Reproduce

  1. Start Claude Code in interactive mode
  2. Press Ctrl-G to trigger external editor for prompt editing

Expected Behavior

The configured text editor should open, allow prompt editing, and return cleanly to Claude Code upon save/exit.

Actual Behavior

With vim (EDITOR=vim):

  • Screen shows vim-like interface with horizontal lines and garbled text in array brackets
  • Terminal becomes completely corrupted and unrecoverable
  • No key combinations work (Ctrl-C, Escape, q, etc.)
  • Only option is to force-close the terminal window entirely
  • Results in complete loss of Claude Code session

With nano (EDITOR=nano):

  • Nano opens and allows text editing
  • When attempting to save and exit, nano prompts to save with a different filename
  • Cannot return to Claude Code properly

Impact

  • Feature is completely unusable across all tested terminal emulators
  • Forces users to kill terminal sessions, losing all work
  • Happens consistently on every attempt

Additional Context

This appears to be an issue with how Claude Code is:

  1. Launching the external editor process
  2. Capturing/restoring terminal state before/after editor invocation
  3. 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.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗