[BUG] Terminal flickering and scrollbar rapid resizing when output exceeds window height
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?
## Terminal flickering and scrollbar rapid resizing when output exceeds window height
Version: 2.0.30 (regression started in 2.0.29)
Environment:
- Terminal: GNOME Terminal 3.52.0
- VTE Library: 0.76.0 (+BIDI +GNUTLS +ICU +SYSTEMD)
- TERM: xterm-256color
- Shell: bash
- OS: Ubuntu Linux (6.8.0 kernel)
- Terminal Window Size: 24 rows × 80 columns
- Locale: C.UTF-8
Critical Trigger Condition:
- Only occurs when Claude output exceeds terminal window height (24 lines)
- Output gets split across multiple screens
- Not related to total session size or conversation history length
- Workaround tested (limiting scrollback to 1000 lines) - no effect
Symptoms:
- Terminal Scrollbar Flickering:
- Scrollbar rapidly alternates between full height (no scrolling) and normal size
- Creates visible flashing/flickering effect while streaming output
- Suggests terminal buffer being repeatedly cleared and re-rendered
- Input Lag:
- Keyboard input becomes slow and unresponsive during output streaming
- Noticeable delay between keypress and character appearance
- Intermittent Behavior:
- Issue comes and goes within the same session
- Not constant - appears to be cyclical
Reproduction Steps:
- Open GNOME Terminal
- Start Claude Code session
- Request a task/prompt that produces output exceeding 24 lines
- Observe scrollbar flickering while output streams
- Try typing during output - input lag will be apparent
Expected Behavior:
Terminal should render streaming output smoothly without flickering. Scrollbar should remain stable. Input should stay
responsive.
Root Cause Hypothesis:
Claude Code v2.0.29+ appears to be issuing terminal control sequences that:
- Clear or reset the terminal buffer during streaming output
- Immediately re-render content
- Cause VTE (GNOME Terminal's rendering library) to recalculate the scrollable region
- Only manifests when content spans multiple terminal heights
Additional Notes:
- Issue does not occur with shorter outputs that fit in terminal window
- Scrollbar behavior (expanding to full height, then shrinking back) is the key visual symptom
- Appears to be related to how output buffering/rendering is handled during streaming
What Should Happen?
formulate the lines 1 by 1
Error Messages/Logs
Steps to Reproduce
write a lot of output lines. Session is already very old and use /resume every time
Claude Model
Sonnet (default)
Is this a regression?
Yes, this worked in a previous version
Last Working Version
2.0.28
Claude Code Version
2.0.29/30/31
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
Xterm
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗