[BUG] [CLAUDE_CODE_NO_FLICKER] Ctrl-G external editor: raw keycodes logged to terminal, input frozen after editor closes

Resolved 💬 5 comments Opened Apr 2, 2026 by LorcanChinnock Closed Jul 3, 2026

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?

When using Ctrl-G to open the plan in an external editor while in plan mode with CLAUDE_CODE_NO_FLICKER=1, two things go wrong:

  1. While the external editor is open, any mouse movement or keypress in the Claude Code terminal causes raw ANSI escape sequences to be written directly to the terminal output (e.g. ^[[<51;120;17M^[[<51;120;16M...). This suggests the kitty keyboard protocol and mouse tracking are not being suspended before the editor is spawned.
  2. After closing the external editor, Claude Code stops accepting input entirely. The session is frozen and must be killed.

Screenshot of raw escape sequences printed during editor session:

<img width="1279" height="190" alt="Image" src="https://github.com/user-attachments/assets/d56ae9b3-dc92-4a5d-a94e-6eb13d62f387" />

What Should Happen?

  • Mouse and keyboard input should be silently ignored or suppressed while the external editor is open.
  • After the editor closes, Claude Code should resume accepting input normally.

Error Messages/Logs

Steps to Reproduce

  1. Launch Claude Code with "CLAUDE_CODE_NO_FLICKER": "1"
  2. Enter plan mode
  3. Press Ctrl-G to open the plan in an external editor
  4. Move the mouse or press any key in the Claude Code terminal while the editor is open — raw escape sequences appear
  5. Close the external editor
  6. Attempt to type in Claude Code — input is frozen

Claude Model

Sonnet (default)

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.90

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Other

Additional Information

Using Ghostty

Related issues with the same root cause or overlapping symptoms:

  • #39769 — Kitty keyboard protocol sequences leak into external editor via Ctrl+G (same root cause)
  • #24563 — Input frozen after returning from Ctrl+G external editor (same post-close symptom, different trigger)

View original on GitHub ↗

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