Repository navigation
fix(agents): keep Claude Code off the alternate screen so session logs scroll - #465
Merged
Merged
Conversation
…s scroll Claude Code picks its fullscreen renderer on a fresh install, and every agent container is one. That renderer enters the alternate screen inside the 80x24 detached tmux pane and repaints a single frame with cursor moves, so nothing reaches the scrollback: the stored log replays as one frozen frame, the live tail and quota scan see 24 rows, and the ANSI- stripped MCP log reads as glued words. CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN=1 is checked before the fresh-install branch in the CLI's renderer choice (verified in the 2.1.294 binary the image pins) and selects the classic renderer, which prints the conversation into the scrollback. Codex had the same problem, fixed in #444 via tui.fullscreen_transcript=false. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Artem Petrov <[email protected]>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A finished Claude Code session's terminal log (for example prod session 28686) replays as one frozen frame, stuck on the spinner, with nothing to scroll back to. The stored log is not truncated. It holds the full raw stream, but Claude Code drew that stream on the alternate screen.
\e[?1049h) inside the 80x24 detached tmux pane and repaints a single frame with cursor moves. Nothing reaches the scrollback, so:tmux capture-pane) see 24 rows;get_session_logstrips ANSI, which turns the cursor moves into glued words.CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN=1selects the classic renderer, which prints the conversation into the scrollback. In the CLI's renderer choice, this env check (env_off) comes before the fresh-install branch. I checked this in the 2.1.294 linux binary the image pins, and in 2.1.296.tui.fullscreen_transcript=false).This is not a regression from the #443 CLI bump: sessions from 2026-10-07 on CLI 2.1.281 paint the same way.
Verification
On a local worktree stack with the agent image built at CLI 2.1.294, I ran a non-interactive haiku session with 12 separate shell calls and a 40-line answer:
terminal_output.loghas no\e[?1049hand has 1721 newlines (the prod log for 28686 had 1). The banner readsv2.1.294, so the classic renderer is in use;claude_code_adapter_test.rbandchangelog_test.rbpass (164 runs), and rubocop is clean on the changed files.Logs that are already stored stay single-frame. The fix applies to sessions launched after deploy.
🤖 Generated with Claude Code