Skip to content

Scrollback content lost mid-conversation in tmux sessions #42180

@creatoraligned

Description

@creatoraligned

Description

In tmux sessions, scrollback content from early/middle portions of a conversation disappears after extended use (~20+ turns). Scrolling to the top still shows the Claude Code session header (icon, working directory, context size), but the conversation content between the header and the current viewport is missing.

Outside tmux (same terminal emulator, same session length), scrollback is fully intact.

Environment

  • Terminal: Ghostty
  • Shell: zsh
  • tmux: yes (with history-limit 50000)
  • Claude Code model: Opus 4.6 (1M context)
  • OS: macOS (Darwin 25.4.0)

Steps to reproduce

  1. Launch Claude Code inside a tmux session
  2. Have an extended conversation (20+ turns, or several long responses)
  3. Scroll to the top of the tmux pane

Expected behavior

Full conversation history visible in tmux scrollback, from session header through all turns.

Actual behavior

  • Session header (Claude Code icon, folder, 1M context) is visible at the top
  • Early/middle conversation turns are missing
  • Scrollback picks up again somewhere in the middle or near the end

Analysis

This doesn't appear to be tmux buffer overflow — if the buffer overflowed, the header at the very top would be the first thing lost. Instead, the header is preserved and the middle content is gone, suggesting Claude Code's TUI is issuing terminal clear/redraw sequences during re-renders that tmux's scrollback captures as content removal. Outside tmux, Ghostty appears to handle these clear sequences differently (preserving scrollback).

The same conversation in a non-tmux Ghostty window retains full scrollback.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions