Preflight Checklist
Bug Description
When running Claude Code inside tmux, the TUI scrollbar disappears and scrolling breaks completely.
Without tmux (normal terminal):
- Claude Code TUI shows a scrollbar on the right side of the conversation output
- Mouse wheel scrolls the conversation history (previous messages, tool results, etc.)
- Works perfectly
Inside tmux:
- The scrollbar disappears entirely
- Mouse wheel scrolls the input box history (like pressing arrow up/down), cycling through previous commands instead of scrolling conversation output
- There is no way to scroll the conversation output — only the very bottom is visible
tmux set -g mouse on/off doesn't help in either mode
This also affects other similar TUI tools (e.g. OpenAI Codex CLI has the same issue in tmux).
Steps to Reproduce
- Start tmux:
tmux new-session -s test
- Run Claude Code:
claude
- Ask Claude something that produces long output
- Try to scroll up with mouse wheel
- Expected: conversation history scrolls up with scrollbar visible (as it works outside tmux)
- Actual: input box cycles through command history (like arrow up/down), no scrollbar, conversation output not scrollable
Root Cause
The TUI appears to detect different terminal capabilities when running inside tmux ($TMUX is set), falling back to a degraded mode where:
- The scrollbar component is not rendered
- Mouse wheel events are routed to input history navigation instead of conversation viewport scrolling
This is likely related to how the Ink framework handles alternate screen buffer and mouse tracking inside tmux. tmux intercepts certain escape sequences for mouse event handling, which breaks the TUI's ability to receive and process scroll events for its own viewport.
Proposed Solution
- Detect tmux environment and ensure the scrollbar still renders and mouse wheel routes to conversation viewport
- Or add a config option / CLI flag (e.g.
--no-mouse or disableMouseCapture in settings) to disable mouse capture, letting tmux handle scrollback natively
- Or provide a keyboard shortcut for scrolling conversation output (e.g. Page Up/Down) that works regardless of terminal environment
Environment
- OS: Linux (WSL2 - Ubuntu)
- Terminal: Windows Terminal → WSL2 → tmux 3.x
- Claude Code: latest version
Related Issues
Preflight Checklist
Bug Description
When running Claude Code inside tmux, the TUI scrollbar disappears and scrolling breaks completely.
Without tmux (normal terminal):
Inside tmux:
tmux set -g mouse on/offdoesn't help in either modeThis also affects other similar TUI tools (e.g. OpenAI Codex CLI has the same issue in tmux).
Steps to Reproduce
tmux new-session -s testclaudeRoot Cause
The TUI appears to detect different terminal capabilities when running inside tmux (
$TMUXis set), falling back to a degraded mode where:This is likely related to how the Ink framework handles alternate screen buffer and mouse tracking inside tmux. tmux intercepts certain escape sequences for mouse event handling, which breaks the TUI's ability to receive and process scroll events for its own viewport.
Proposed Solution
--no-mouseordisableMouseCapturein settings) to disable mouse capture, letting tmux handle scrollback nativelyEnvironment
Related Issues