Skip to content

[BUG] Terminal rendering corruption in tmux - text overlaps and overwrites previous output #29937

Description

@efloehr

Environment

  • Claude CLI version: 2.1.63
  • Operating System: Ubuntu (Linux 6.8.0)
  • Terminal: tmux inside alacritty/standard terminal emulator
  • TERM: tmux-256color
  • Platform: Anthropic API

tmux configuration (ruled out as cause)

set -sg escape-time 10
set -g default-terminal "tmux-256color"
set -ga terminal-overrides ",xterm-256color:Tc"
set -g history-limit 50000
set -g focus-events on

alternate-screen is on (default).

Bug Description

During normal Claude Code sessions in tmux, the terminal rendering becomes corrupted. Text from different parts of the session (code output, permission prompts, previous responses) overlaps and overwrites each other on the same lines, making the interface unreadable.

This is not caused by:

  • Resizing tmux panes (happens without any resize)
  • Incorrect TERM settings
  • Missing tmux configuration

The corruption appears to be in Ink's internal render state — the line positions it caches become out of sync with what's actually displayed. Once corrupted, neither Ctrl-L (terminal redraw) nor tmux's redraw (prefix + r) fixes it, since the problem is in Ink's virtual buffer, not the terminal's.

Steps to Reproduce

  1. Run Claude Code inside a tmux session
  2. Have a multi-turn conversation with tool calls (Bash commands, file reads, etc.)
  3. Eventually the renderer gets into a corrupted state where new output overwrites previous text

The trigger seems to be Ink's full-buffer redraw cycle — particularly when permission prompts appear mid-render, but it also happens during normal streaming output.

Expected Behavior

Text should render sequentially without overlapping. New output should appear below previous output.

Actual Behavior

Text from different render cycles (code blocks, permission dialogs, streaming responses) is drawn at overlapping positions, producing garbled/unreadable output. The corruption persists until the session is restarted.

Workaround

Only reliable fix is /clear or restarting the session.

Related Issues

All three issues appear to stem from the same root cause: Ink redraws the entire terminal buffer on each render cycle rather than doing targeted line updates, and the calculated positions drift from actual terminal state over time.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:tuibugSomething isn't workingplatform:linuxIssue specifically occurs on Linux

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions