TUI doesn't redraw after external editor (Ctrl+G) closes
Description
After using Ctrl+G to open an external editor (neovim), the TUI does not properly redraw when the editor exits. The entire conversation area is blank — only the prompt input line and project badge at the bottom are visible. The conversation history only reappears when Claude starts generating new output, or when the terminal window is resized.
Observed behavior
- Press Ctrl+G — Claude Code appears to clear the entire terminal before spawning the editor process
- Editor opens (neovim, which uses alternate screen buffer)
- Save and quit the editor
- Terminal shows: blank/dark conversation area, only the bottom prompt bar is visible
- Switching terminal tabs does NOT trigger a redraw
- Resizing the terminal window DOES trigger a redraw and restores the full conversation
- Claude generating new output also triggers a redraw
This suggests the Ink TUI is not calling a repaint/fullRedraw after the editor child process exits. The underlying state is fine — it's purely a rendering issue.
Workaround attempts
kill -SIGWINCH $PPIDafter editor exits — did not work- Terminal resize escape sequences (
\e[8;...t) after editor exits — did not work printf '\e[?1049l'(force exit alternate screen) — did not worktmux popup -E(isolates editor in separate PTY) — partially works, but Claude Code still clears the screen behind the popup when entering editor mode, and redraws slightly offset after returning
Environment
- macOS (Darwin 24.6.0)
- Terminal: Ghostty
- Editor: neovim (configured via custom editor script)
- Running inside tmux for the popup workaround
Expected behavior
The TUI should trigger a full repaint immediately after the external editor process exits, regardless of whether the editor used the alternate screen buffer.
Note: I have screenshots demonstrating the issue but gh CLI doesn't support image uploads. Happy to add them if requested.
This issue has 7 comments on GitHub. Read the full discussion on GitHub ↗