Skip to content

tui.json "mouse": false causes mouse wheel to fall back to arrow keys, triggering prompt-history navigation instead of scrolling the message viewport #35295

Closed as not planned

Description

@ayakabot

Description

When I set "mouse": false in tui.json (intending to fully disable mouse input in the TUI), the mouse wheel does NOT scroll the visible message viewport — the chat area that shows all past messages, both my prompts and the agent's responses.

Instead, mouse-wheel events fall back to arrow-key events inside the prompt editor, which cycles through my previously-sent prompts (the prompt-history list). So mouse: false effectively turns "scroll chat" into "navigate my old prompts", which is the opposite of what I expected.

This means that with mouse: false, there is no way at all to scroll the chat viewport using the mouse — and using the wheel accidentally cycles my prompt history.

Plugins

none

OpenCode version

v1.17.13

Steps to reproduce

  1. Start a session with enough messages to exceed the viewport height (so scrolling is actually needed to see earlier messages).

  2. Put this in ~/.config/opencode/tui.json:

    {
      "mouse": false
    }
  3. Launch opencode.

  4. Make sure the prompt input has focus (no popup / autocomplete open).

  5. Scroll the mouse wheel up and down.

Screenshot and/or share link

N/A

Operating System

Debian 13

Terminal

zsh

Additional Context

It looks like the implementation falls back to converting mouse-wheel events into Up/Down arrow-key events when mouse: false. Those arrow keys then reach the prompt editor, where they navigate prompt-history rather than scrolling the chat viewport.

I would expect one of:

  • mouse: false → wheel events are fully ignored (so there's no accidental prompt-history navigation, even if it means the chat viewport can't be scrolled with the mouse while disabled), or
  • mouse: false → wheel still scrolls the chat viewport (only click / select is disabled).

Either way, "wheel = arrow key = prompt history navigation" is not desirable.

Activity

  1. jiexray commented on Jul 6, 2026

    @jiexray

    hi, I also met this problem with OpenCode 1.17.13. I have setup this in ~/.config/opencode/opencode.json, but nothing works.

    {
        "tui": {
            "mouse": false,
            "auto_scroll": false
        }
    }
    
    
  2. rharmonson commented on Jul 20, 2026

    @rharmonson

    I started to have the silly scroll up in the prompt versus window as of 1.17.x, but disabling mouse and auto scroll has no effect when placed in user or project config files (opencode.jason nor tui.json). I am using 1.18.4 and the issue persists. Quite infuriating for the mouse behaved as expected prior to whatever change was made in 1.17.x.

  3. rharmonson commented on Aug 2, 2026

    @rharmonson

    Anyone found a solution for this? It is driving me absolutely f'ing nuts.

  4. rharmonson commented on Aug 15, 2026

    @rharmonson

    Anyone found a solution for this? It is driving me absolutely f'ing nuts.

    On resolving my issue, it does not appear to be the same as the original post. Apologies.

    Updating my terminal configuration, $HOME/.config/foot/foot.ini, fixed the issue for me.

    On researching, I found references to the feature and default value as far back as 2022, so the feature is unlikely to be the root cause. It does, however, fix the problem.

    Hopefully, other foot users will benefit.

    # default value is 'yes' but breaks opencode v1.17.3+ mouse handling.
    alternate-scroll-mode=no
    
  5. 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