Skip to content

Mouse capture blocks right-click paste in Windows Terminal #48004

Open

Description

@lybhb8

Description

When using the OpenCode TUI inside Windows Terminal (v1.24) on Windows, the mouse option is an all-or-nothing switch:

  • mouse: true (default): wheel-scrolling of chat history works, but right-click is consumed by the app, so right-click paste does not work even though Windows Terminal is configured with interaction.rightClick: "paste". Pasting only works via Alt+right-click or Ctrl+Shift+V.
  • mouse: false: right-click paste works (Windows Terminal handles it), but wheel scrolling no longer scrolls the chat view (mouse events are not delivered to the TUI).

Expected behavior

Wheel scrolling and terminal-level right-click paste should be able to coexist. Ideally:

  1. The mouse setting should be split, e.g. control wheel-scrolling / left-click separately from right-button capture, so right-click can fall through to the terminal emulator.
  2. Or the TUI should not capture the right mouse button at all, leaving it to the terminal for paste / context menu.

Environment

  • OpenCode TUI in Windows Terminal 1.24.11911.0
  • OS: Windows
  • Config: ~/.config/opencode/tui.json (also tui.json global config)

Workaround today

mouse: true + Alt+right-click to paste, or switch mouse: false and give up wheel scrolling in the chat view.

Activity

  1. github-actions commented on Sep 8, 2026

    @github-actions
    Contributor

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

    If your issue has additional details or a different angle (e.g. the Windows Terminal-specific interaction.rightClick setting or the request to split mouse capture granularity), feel free to clarify and a maintainer can decide whether to keep this open or close it as a duplicate.

  2. opencodejr commented on Oct 28, 2026

    @opencodejr

    Thanks for the detailed write-up, @lybhb8!

    You'd like mouse wheel scrolling and Windows Terminal's right-click paste to work together, either by splitting the mouse option into finer controls or by having the TUI not take over the right mouse button.

    Some background on why it works this way now:

    • With mouse: true, OpenCode turns on the terminal's mouse capture. While capture is on, Windows Terminal sends every click to the app, right-clicks included, so its own rightClick: "paste" action can't run. That's why Alt+right-click and Ctrl+Shift+V still work.
    • The TUI already uses right-click: when terminal.copy isn't "select" (on Windows it defaults to "manual"), right-click copies the current selection. When nothing is selected, right-click does nothing.

    One option is for right-click with nothing selected to paste from the clipboard, so you'd get copy-or-paste behaviour like Windows Terminal's while keeping wheel scrolling. I've marked this as a feature request for the maintainers to consider.

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