Fullscreen alt-screen TUI teardown freezes VS Code integrated terminal over Remote-SSH on exit
Summary
On exit, Claude Code's fullscreen alt-screen TUI renderer (default in 2.1.x) tears down the alternate screen buffer and repaints scrollback to the main screen. Inside a VS Code Remote-SSH integrated terminal, that bursty repaint hangs the terminal renderer long enough that the client↔server connection drops and then reconnects — so the entire VS Code window freezes for several seconds on every Claude exit.
Related (same alt-screen-buffer / integrated-terminal area, different symptom): #69342.
Workaround that fixes it
Switching to the classic main-screen renderer eliminates the freeze entirely:
/tui default, or"tui": "default"in~/.claude/settings.json, orCLAUDE_CODE_DISABLE_ALTERNATE_SCREEN=1
So the fullscreen alt-screen default is the trigger.
Evidence (server-side VS Code logs, one burst per Claude exit)
~/.vscode-server/data/logs/<date>/ptyhost.log:
Persistent process "11": Process had no disconnect runners but was an orphan
Persistent process reconnection "11"
Persistent process "11": Replaying 5330 chars and 1 size events
remoteagent.log:
[error] Error: Unexpected SIGPIPE
[info] ManagementConnection ... The client has disconnected, will wait for reconnection 3h before disposing...
Ruled out
- Multiple windows / MCP-server contention — reproduces with a single window open.
- User hooks (SessionEnd/Stop) — return in ~24ms, spawn detached with
stdio: ignore. - Cloud-metadata probes in ptyhost.log ("Shell integration cannot be enabled" for wget/curl to 169.254.169.254 / metadata.google.internal) — each fails in <60ms; not a stall, unrelated.
Expected
Exiting the fullscreen TUI should not stall the Remote-SSH terminal renderer or drop the client↔server connection. The alt-screen teardown repaint should be incremental/bounded enough that a Remote-SSH integrated terminal can absorb it.
Environment
- Claude Code CLI 2.1.196; VS Code extension
anthropic.claude-code-2.1.196 - VS Code Remote-SSH (vscode-server commit
7e7950df) - Host: Ubuntu 24.04.4 LTS, kernel 6.8.0-124-generic, running as a VirtualBox VM
- Renderer: fullscreen (default) reproduces;
defaultdoes not