TUI: closing background-task detail panel leaves dead viewport space below input
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
- Run a long-running command in a background shell (e.g.
rtk powershell.exe -ExecutionPolicy Bypass -File 'C:\Users\User\install-fonts.ps1') - Open the background task overlay → arrow to the running shell → Enter to view its "Shell details" panel with live output
- Close the panel (Esc / Enter / Space)
- 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.
3 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
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: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.
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.