TUI: closing background-task detail panel leaves dead viewport space below input

Status Fixed / completed
Maintainer reply None cached
Activity 3 comments · opened May 9, 2026 · closed May 9, 2026

Description

When I open a background task's detail panel (Esc → arrow into running shell → Enter to view "Shell details") and then close it (Esc/Enter/Space), the viewport above the input prompt does not reclaim the vertical space the panel occupied. The result is a large empty region below the input box that persists until the next full redraw or window resize.

Steps to reproduce

  1. Run a long-running command in a background shell (e.g. rtk powershell.exe -ExecutionPolicy Bypass -File 'C:\Users\User\install-fonts.ps1')
  2. Open the background task overlay → arrow to the running shell → Enter to view its "Shell details" panel with live output
  3. Close the panel (Esc / Enter / Space)
  4. Observe: the input prompt sits high in the viewport with a tall blank region below it

Expected

The TUI should compact the layout when the panel is dismissed, so the prompt and status bar return to the bottom of the viewport (no dead space below).

Actual

A large blank region remains below the input prompt for the rest of the turn until something forces a full redraw (Ctrl+L, window resize, or a new long response from the model).

Environment

  • Claude Code: latest
  • Terminal: WezTerm 20240203-110809 (OpenGL front-end)
  • OS: Windows 11 (WSL2 Ubuntu)
  • Reproducible: every time the panel is opened and closed

Workaround

Ctrl+L re-draws and clears the dead space, but it should not be needed.

Notes

Likely root cause: the detail panel exit handler doesn't emit a clearing/resize escape sequence, leaving the prior occupied rows untouched in the alternate buffer.

---

Filed by Claude Opus 4.7 acting as a coding agent on behalf of @royachiron, who observed and reproduced the bug while we were working together.

View original on GitHub ↗

3 Comments

github-actions[bot] · 5 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/53952
  2. https://github.com/anthropics/claude-code/issues/52731
  3. https://github.com/anthropics/claude-code/issues/52027

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

royachiron · 5 months ago

Workaround (Claude Code 2.1.119, Windows 10/11)

After testing every terminal-side and settings.json-side toggle, the only effective fix is the environment variable:

CLAUDE_CODE_NO_FLICKER=1

Set as a User environment variable on Windows (persists across sessions). Immediately stops scrollback duplication across all documented triggers: resize, long sessions, large tool outputs, modal dismissal.

Activates the fullscreen alt-screen renderer instead of the default in-place redraw, which is what was leaving the dead viewport region after the detail-panel close.

Tested in WezTerm + WSL2 Ubuntu; same fix should apply in Windows Terminal, Alacritty, and other terminals that don't otherwise force alt-screen.

Reporting it here so the next person searching this issue finds the workaround quickly while a proper fix is considered.

github-actions[bot] · 3 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.