[BUG] TUI flickers/cursor jumps in tmux during streaming output (missing DECSET 2026 synchronized output)
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
When running Claude Code inside tmux, the terminal visibly flickers/blinks whenever Claude generates output. The cursor appears to reset to the top of the render area and then jump back to the current position on every TUI update. This is especially noticeable when streaming large outputs such as code diffs.
The issue occurs in all Claude Code instances when actively generating text — idle instances don't exhibit the problem.
What Should Happen?
Smooth, flicker-free rendering. The TUI should use synchronized output (DECSET 2026: \e[?2026h ... \e[?2026l) to batch screen updates into atomic redraws, preventing visible cursor repositioning during renders.
Root Cause Analysis
The Ink/React-based TUI renderer performs full re-renders when streaming output. Each render cycle involves:
- Moving cursor up to the start of the render area
- Clearing lines
- Writing new content
- Repositioning cursor
Without synchronized output wrapping, each of these steps is individually flushed to the terminal, making the intermediate cursor positions visible as flicker.
tmux 3.4+ supports synchronized output passthrough — when configured with set -as terminal-features ',xterm*:sync', tmux will correctly forward DECSET 2026 sequences to the outer terminal. However, the application itself must emit these sequences. The Ink library (or Claude Code's rendering layer) does not appear to emit \e[?2026h / \e[?2026l around render cycles when running in tmux.
Environment
- Claude Code version: 2.1.81
- tmux version: 3.4
- TERM inside tmux:
tmux-256color - Outer terminal TERM:
xterm-256color - Detected terminal features:
bpaste,ccolour,clipboard,cstyle,focus,sync,title - OS: WSL2 (Linux 6.6.87.2-microsoft-standard-WSL2) with Windows Terminal
- Shell: bash
tmux configuration
set -g default-terminal "tmux-256color"
set -as terminal-features ',xterm*:sync'
set -g visual-activity off
set -g visual-bell off
setw -g monitor-activity off
What was ruled out
monitor-activity/visual-bell— disabled, no effect- Hooks firing frequently — removed
PreToolUsehooks, no effect statusLinecommand — disabled, no effectprefersReducedMotion: true— enabled, no effect- Pane position — issue follows the Claude instance, not the tmux pane position (confirmed by swapping panes)
- Session state — fresh session in a new Claude instance reproduces the issue
Steps to Reproduce
- Run Claude Code inside tmux 3.4+ with split panes
- Ask Claude to perform a task that generates large output (e.g., a code edit with a visible diff)
- Observe visible cursor flickering/jumping during output streaming
- Compare with an idle Claude instance in another pane — idle instances don't flicker
Suggested Fix
Wrap each Ink render cycle with synchronized output escape sequences:
\e[?2026h (begin synchronized update)
... cursor movement, clear, write ...
\e[?2026l (end synchronized update)
This should be conditional on terminal support (check for TERM containing tmux or xterm, or query via DECRQM). tmux 3.4+ and most modern terminals (Windows Terminal, iTerm2, Alacritty, kitty, foot) support DECSET 2026.
Related Issues
- #19533 — similar corruption in GNU Screen (which lacks DECSET 2026 support entirely — the inverse problem)
- #34794, #34242 — possibly related scroll/rendering issues
Claude Model
Opus
Is this a regression?
Unknown
Platform
Anthropic API
Operating System
Other Linux (WSL2)
Terminal/Shell
tmux 3.4 + Windows Terminal
Additional Information
The issue is purely cosmetic but significantly impacts usability when running multiple Claude instances in tmux split panes, as the constant flickering is distracting.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗