Ctrl+G (external editor): large blank space after saving and returning to TUI
Resolved 💬 2 comments Opened Apr 17, 2026 by kazuyuki-m Closed Apr 17, 2026
Bug Description
After using Ctrl+G to open the external editor, editing content, and saving with :wq, a large blank space appears in the TUI between the conversation history and the input area. The blank space grows proportionally with conversation length, requiring extensive scrolling to reach previous messages. This significantly impacts productivity.
Reproduction Steps
claude(no flags needed, also reproducible with--verbose --debug)- Have a few exchanges with Claude (longer conversation = worse)
- Press
Ctrl+Gto open external editor - Delete all text (or modify text — content doesn't matter)
- Save and quit (
:wq) - Observe large blank space between conversation and input area
Key Findings from Investigation
- Content is irrelevant: Happens with empty save, single character
a, single space — all produce the same blank space - Editor is irrelevant: Reproducible with both
vimandnvimas$EDITOR - Flags are irrelevant: Reproducible with plain
claude(no--verboseor--debug) - Scales with conversation length: Longer conversations produce larger blank spaces
- Root cause: Viewport height recalculation after alternate screen buffer restore appears incorrect
Environment
- Claude Code: v2.1.112
- Terminal: Ghostty 1.3.1 (stable, Metal renderer)
- macOS 26.4.1 (Build 25E253)
$EDITOR: vim (also tested with nvim)- TUI mode: default (not fullscreen)
- Shell: zsh
Workaround
tui: "fullscreen" mode in settings.json avoids this issue, but loses terminal scrollback — not acceptable for all users.
Possibly Related Issues
- #4136 — Too much blank space at bottom of terminal
- #10472 — Excessive blank lines causing continuous terminal scrolling
- #14632 — Large Blank Areas Where Text Should Display
- #9218 — Ctrl-G causes terminal corruption
- #10034 — Ctrl+G prompt editor inserts extra blank lines
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗