claude-code - 💡(How to fix) Fix [Bug] TUI not repainting after external editor ($EDITOR) exit without SIGWINCH [1 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#52169Fetched 2026-04-23 07:34:47
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Author
Timeline (top)
labeled ×4closed ×1commented ×1

Root Cause

Likely cause: missing render-on-child-exit callback in the TUI render loop. SIGWINCH works because it forces a full repaint regardless of internal dirty-flag state.

Code Example

[]
RAW_BUFFERClick to expand / collapse

Bug Description

After opening $EDITOR with ctrl-g and closing it, Claude Code's TUI stays blank until it receives an external repaint stimulus. The draft reappears when any of these happen:

  • Resizing the terminal window
  • Changing font size (Cmd+−/Cmd+0 in Ghostty → triggers SIGWINCH)
  • Pressing Enter (submits the draft; repaint is a side-effect)

Expected: the TUI should repaint automatically when the spawned $EDITOR process exits.

Steps to reproduce:

  1. export EDITOR=nvim
  2. Start Claude Code in a plain terminal (no tmux, no wrapper).
  3. Send any message and wait for a response.
  4. Press ctrl-g, edit the draft, :wq.
  5. Observe: the pane stays blank where the TUI should be. Resize the Ghostty window or change font size → TUI reappears.

Also reproduces inside a tmux pane, so it's not tmux- or terminal-multiplexer-specific.

Environment:

  • Claude Code: 2.1.117
  • OS: macOS (Darwin 25.4.0)
  • Terminal: Ghostty 1.3.1
  • Shell: zsh
  • tmux (secondary repro): 3.6a
  • $EDITOR: nvim

Likely cause: missing render-on-child-exit callback in the TUI render loop. SIGWINCH works because it forces a full repaint regardless of internal dirty-flag state.

Environment Info

  • Platform: darwin
  • Terminal: tmux
  • Version: 2.1.117
  • Feedback ID: 60ed5e60-1170-4bd2-9f60-08be3ac07d75

Errors

[]

extent analysis

TL;DR

Implement a render-on-child-exit callback in the TUI render loop to automatically repaint the interface when the spawned $EDITOR process exits.

Guidance

  • Investigate the TUI render loop to identify where a callback can be added to trigger a repaint when the $EDITOR process exits.
  • Verify that the SIGWINCH signal is being handled correctly, as it currently forces a full repaint, and use this as a reference for the desired behavior.
  • Consider adding a debug log or print statement to confirm when the $EDITOR process exits and when the TUI render loop is triggered.
  • Review the Claude Code documentation and source code to see if there are any existing hooks or callbacks that can be utilized for this purpose.

Example

No code example is provided as the issue does not contain sufficient information about the codebase or the specific rendering library being used.

Notes

The provided information suggests that the issue is not specific to tmux or the terminal multiplexer, but rather a missing callback in the TUI render loop. The fact that resizing the terminal window or changing font size triggers a repaint suggests that the rendering code is capable of handling external events, but needs to be modified to handle the $EDITOR process exit event.

Recommendation

Apply a workaround by adding a render-on-child-exit callback to the TUI render loop, as this is the most direct way to address the issue and ensure the TUI repaints automatically when the $EDITOR process exits.

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

claude-code - 💡(How to fix) Fix [Bug] TUI not repainting after external editor ($EDITOR) exit without SIGWINCH [1 comments, 2 participants]