Skip to content

TUI: mouse wheel never captured in iTerm2 (macOS) — wheel scrolls iTerm2's own scrollback instead of the conversation #49622

Closed as not planned

Description

@cjazinski

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:

  1. Config confirmed loading & applying — ~/.local/share/opencode/log/opencode.log shows at TUI startup:
    message="loading tui config" path=/Users/.../.config/opencode/tui.json
    message="applying tui config" path=/Users/.../.config/opencode/tui.json order=1
    
    with tui.json containing "mouse": true (also reproduced with scroll_acceleration enabled and with a plain scroll_speed).
  2. 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.
  3. 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.
  4. 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

  1. iTerm2 3.7.2 on macOS 27.0 (build 26A428), default profile
  2. ~/.config/opencode/tui.json:
    {
      "$schema": "https://opencode.ai/tui.json",
      "mouse": true,
      "scroll_speed": 5,
      "scroll_acceleration": { "enabled": false }
    }
  3. Launch opencode, hold a conversation longer than one viewport
  4. 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.

Activity

  1. github-actions commented on Sep 17, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    If these don't cover your specific case (e.g., the bug persists with mouse: true on current versions), this issue adds useful new detail (iTerm2-specific, with DECSET introspection offer) and can remain open.

  2. thdxr commented on Oct 11, 2026

    @thdxr
    Member

    Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.

    — from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions