anomalyco / anomalyco/opencode
TUI: mouse wheel never captured in iTerm2 (macOS) — wheel scrolls iTerm2's own scrollback instead of the conversation
@simonklee is already working on this.
Since Sep 17, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
On macOS + iTerm2, the mouse wheel / trackpad never scrolls the OpenCode conversation transcript. Instead, iTerm2 scrolls its own native scrollback buffer — i.e., content from before opencode was even launched. The TUI appears to never enable mouse reporting in this environment, so wheel events fall through to the terminal emulator.
Debugging performed to isolate the cause:
- Config confirmed loading & applying —
~/.local/share/opencode/log/opencode.logshows at TUI startup:
withmessage="loading tui config" path=/Users/.../.config/opencode/tui.json message="applying tui config" path=/Users/.../.config/opencode/tui.json order=1tui.jsoncontaining"mouse": true(also reproduced withscroll_accelerationenabled and with a plainscroll_speed). - Not the scroll viewport — keyboard scrolling works perfectly (
PageUp/PageDown,Ctrl+Alt+U/D,Ctrl+G), so transcript scrolling itself is functional; only the mouse layer is dead. - Not iTerm2 configuration — no mouse/scroll overrides in the iTerm2 preferences; iTerm2 defers wheel events to any app that enables mouse reporting. Scrolling its own buffer is the standard behavior when the app hasn't claimed the mouse.
- No multiplexer — running directly in iTerm2, no tmux/screen.
Plugins
- opencode-antigravity-auth@latest, opencode-anthropic-auth@latest, opencode-antigravity-web@latest, opencode-antigravity-img@latest, opencode-wakatime, oh-my-openagent@latest, oh-my-tokens, opencode-agents-sidebar@latest, opencode-autotitle@latest, opencode-log-sanitizer@latest, opencode-dynamic-context-pruning@latest
OpenCode version
1.18.31
Steps to reproduce
- iTerm2 3.7.2 on macOS 27.0 (build 26A428), default profile
~/.config/opencode/tui.json:{ "$schema": "https://opencode.ai/tui.json", "mouse": true, "scroll_speed": 5, "scroll_acceleration": { "enabled": false } }- Launch
opencode, hold a conversation longer than one viewport - Scroll wheel / two-finger trackpad over the conversation pane
Expected behavior
Wheel scrolls the conversation transcript inside the TUI.
Actual behavior
iTerm2 scrolls its native scrollback (pre-launch shell content); the TUI viewport doesn't move.
Operating System
macOS 27.0 (26A428), Apple Silicon
Terminal
iTerm2 3.7.2 (TERM_PROGRAM=iTerm.app)
Additional context
Possibly related (same class of wheel-event delivery failure, different terminals): #33032, #35295, #42501. If there's any low-level introspection that would help (e.g., verifying which DECSET mouse modes the TUI emits at startup), happy to run it — the environment is fully instrumented on my side.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.