Skip to content

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

Open

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

  1. WingsOfPanda commented on Mar 19, 2026

    @WingsOfPanda

    Still reproducing on the latest Claude Code release in tmux on Linux.

    I don’t think this should go stale: newer TUI rendering issues like #35356 and #35803 look plausibly related, and the core symptom here remains the same — the UI render state appears to drift and overwrite existing terminal content, making the session unreadable.

    I’m also still seeing the repeated auto-scroll/jump from the top to the end of the session, which makes the rendering instability noticeably worse, especially on remote machines where the TUI is the only interface. Terminal redraws still don’t recover it; /clear or restarting is still the only reliable workaround for me.

    I’d suggest keeping this open as a canonical tracker for this class of TUI/tmux render-corruption bugs unless there’s already another root issue intended to supersede it.

  2. efloehr commented on Mar 19, 2026

    @efloehr
    Author

    Yes, this is still an issue in 2.1.79. And my use case is exactly as @WingsOfPanda describes: remote machine where TUI is the only interface.

  3. jarnesjo commented on Mar 25, 2026

    @jarnesjo

    Still experiencing this on v2.1.74 in VSCode's integrated terminal on macOS (Darwin 25.3.0). Two symptoms:

    1. Scroll jumping — scrolling up during output causes the terminal to snap back to the top (not bottom), making it impossible to review previous output
    2. Rendering corruption — intermittent garbled/overlapping text that requires restarting the terminal

    Both issues have gotten worse recently and now occur in all projects. /clear helps temporarily but the scroll issue returns immediately when new output is streamed.

  4. RJAFusion commented on Mar 25, 2026

    @RJAFusion

    Yes - I've been having this issue in TMUX session in iTerm2 on MacOs 26.2 for the past week or so. It makes AskUserQuestion tools usage unusable as the selection line renders in the wrong position and text overlaps all over the place.

    Resizing the window forces a redraw, so the AskUserQuestion tool can be used properly, but then it just corrupts text again on the next turn.

    Also have the scroll jumping issue as well

  5. parsakhaz commented on Apr 10, 2026

    @parsakhaz

    this is a huge issue. love claude code but this makes it really really hard to use

    hey. it's fixed at the terminal level here

    greenfield-inc/Pane#120

    open source, using xtermjs which is the same terminal as VS Code. feel free to copy this fix or download the latest release to run claude code on any operating system with the fix in place. i was so mad and frustrated at this that I had to fix it myself.

    Not just a scrolling issue — also a rendering/layout problem in VS Code's side-by-side panel mode.

    When Claude Code runs in VS Code with the terminal on one side and the editor on the other, text formatting breaks in unpredictable ways. Options and multi-line output get weirdly split left-right, text wraps incorrectly, and the whole experience feels janky rather than fluid. Combined with the scroll-jumping, longer sessions in VS Code become genuinely hard to follow.

    This isn't just macOS standalone terminal — it's very much a VS Code integrated terminal issue too.

    yeah i had to switch off cursor/vscode and build myself an ide that managed xtermjs (the library they both use) well enough for the complex TUIs to not break.

    works great and i have a fix for the scroll jump i just implemented rn here

    greenfield-inc/Pane#120

  6. KnightHawk06 commented on Apr 13, 2026

    @KnightHawk06

    Happens in Konsole too.

  7. Kevin7Qi commented on May 10, 2026

    @Kevin7Qi

    Still seeing this on Claude Code v2.1.138 with Ghostty on macOS, over SSH into a tmux session on a Linux remote.

    In my case, this appears to be Ghostty-specific: the same remote tmux session works normally from macOS Terminal.app, and also works normally from Windows Terminal. Forcing a more conservative TERM value did not resolve it in Ghostty.

  8. u35253 commented on May 23, 2026

    @u35253

    Yes, as a TUI, I would anticipate that claude code would not get corrupted after about 1 minute of use when simply running in a tmux pane via ssh. But it does, much the OP describes, except it really just seems to stop. Everything else in the ssh/tmux session keeps working. iterm2 is running on macOS 15.7 host, with the macOS 26 guest VM being ssh'd into, where claude is allowed to run. (What is the path to success? If I find out, I hope to come back and comment here with an answer.)

  9. 12 remaining items

  10. e-e-e commented on Jun 15, 2026

    @e-e-e

    Does anyone from anthropic actually look at these issues? Or is this just triaged by ai now?

    Claude code ludicrously broken because of this bug. Is there irony in advertising models world ending capabilities while a tui rendering issue is seemingly unaddressable

  11. TelpeNight commented on Jun 17, 2026

    @TelpeNight

    The same issue outside tmux on MacOS/Ghostty

  12. devyoyaku commented on Jun 18, 2026

    @devyoyaku

    Exact same issue, using Tmux and iTerm on MacOS. This is really annoying.

    As a workaround Ctrl+Z -> fg also works to reset normal output.

  13. jhogendorn commented on Jun 18, 2026

    @jhogendorn

    as per @mbsulliv on a related issue, disabling vim mode has stopped this issue for me for the moment it seems.

  14. imsurat commented on Jun 22, 2026

    @imsurat

    Still reproducing on iTerm2 (macOS, no tmux), and the trigger is very consistent for me: switch to another tab in the same iTerm2 window and switch back → Claude's next output starts redrawing from the top of the window and overwrites existing on-screen text.

    Details / data points:

    • Started ~mid-June 2026. Previously I only saw this during /compact; now any tab-switch-and-return triggers it, and it's reliably reproducible that way.
    • Resize-to-redraw did not recover it for me (contrary to what worked for some others here), and Ctrl+L also failed. The only thing that cleared it was Ctrl+K (clear iTerm2 scrollback) — which fixes the corruption but destroys all scrollback context.
    • Behavior is consistent with render-state drift accumulating over a session: after a full Ctrl+K clear it behaves for a while, then the corruption returns once enough redraw/focus events pile up. App-level repaints (resize, Ctrl+L) don't help because the drifted cursor position just repaints wrong again; only resetting the terminal's own buffer (Ctrl+K) recovers it.

    Plain iTerm2, no tmux involved here, so this isn't tmux-specific. Happy to provide a screen recording if useful.

  15. grunsab commented on Jun 23, 2026

    @grunsab
    Image

    I'm getting this issue on inbuilt Terminal on Mac

  16. jeffreymrusselleco commented on Jun 23, 2026

    @jeffreymrusselleco

    From what I can see, vim mode seems to be the common thread. Can other people confirm this? @grunsab @imsurat

  17. grunsab commented on Jun 23, 2026

    @grunsab

    @jeffreymrusselleco Mine is set to standard mode, and not vim mode, according to the config settings.

  18. nem75 commented on Jun 23, 2026

    @nem75

    Can't confirm that setting editor to standard mode is a functioning workaround. For me it now takes longer before the issue surfaces, but in the end output on scrollback/resize corrupts the same.

    Only working workaround for me is downgrade: #29937 (comment)

    Edit: living without vim bindings is not living, anyway.

    Edit 2: have to concede that vim mode also plays a role. Still getting corrupted output even in downgraded client version, if in vim mode. Switching back to normal mode.

    (This is really quite horrible.)

  19. imsurat commented on Jun 23, 2026

    @imsurat

    @ jeffreymrusselleco, yes, I can confirm this. With standard mode, I was seeing it only after the compact finished. With vim mode I see it much more often. Missed adding this in my comment yesterday.

  20. meowcakes commented on Nov 4, 2026

    @meowcakes

    Still experiencing this with COSMIC terminal...

  21. colrichie commented on Nov 7, 2026

    @colrichie

    I'd like to add a data point that matches this issue closely.

    Environment: Windows Terminal → SSH → tmux → claude CLI (Linux host)

    What happened:

    • Mid-session, an auto-update notification appeared at the bottom of the screen ("✔ Update installed · Restart to update"), and shortly after that the screen split, with a file-diff review panel (listing changed files with [ask] permission tags) appearing on the right side, overlaid on the conversation.
    • That panel became completely frozen: no response to mouse clicks, Esc, q, or Ctrl-c. Eventually even tmux's own prefix key (Ctrl-b) stopped responding (apart from Ctrl-b d for detach, which still worked at first).
    • tmux's refresh-client command had no effect either, so this looks like the TUI's own rendering state being corrupted rather than a terminal-side redraw issue.

    Version: the corruption happened on the version just prior to 2.1.319 — i.e. the auto-update that triggered the "Update installed" notice was the update to 2.1.319.

    Recovery: /exit, then tmux kill-session to destroy the tmux session entirely, create a new tmux session, and claude --resume inside it. This fully resolved the corruption (now running cleanly on 2.1.319). Simple terminal-level fixes (resize, tab switch, tmux refresh-client) did not help — only destroying and recreating the tmux session + resuming did.

    This matches the pattern described above (freeze that survives redraw attempts, only a full session restart fixes it), and in my case it appears to have been triggered right around an in-session auto-update.

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