Skip to content

Right-click paste doesn't work in TUI when mouse capture is enabled #36456

Closed as not planned

Description

@yininghase

When mouse: true (default) in tui.json, the TUI captures all mouse events, which suppresses the terminal native right-click context menu. The right-click handler returns early when OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECT is not set, so no paste action occurs.

The paste infrastructure already exists — bracketed paste (onPaste handler) and prompt.paste command both work. The fix would be to have the right-click handler call prompt.paste (or trigger bracketed paste) instead of returning early when copy-on-select is enabled.

Expected behavior: Right-click pastes clipboard content into the prompt input.

Actual behavior: Right-click does nothing (mouse captured, no paste action).

Workarounds:

  • Ctrl+Shift+V works
  • Setting "mouse": false in tui.json restores native terminal menu (but loses select-to-copy / seamless copy behavior)

Environment:

  • Linux X11, DISPLAY=:0
  • opencode v1.17.18

Activity

  1. github-actions commented on Jul 11, 2026

    @github-actions
    Contributor

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

  2. simonklee commented on Jul 12, 2026

    @simonklee
    Member

    I've been meaning to get much closer to native copy-paste feeling. Let me have a look at the pr

  3. yylzl commented on Sep 9, 2026

    @yylzl

    Same issue on WezTerm + WSL2 (Ubuntu). WezTerm is configured with right-click mapped to paste from clipboard, and opencode needs "mouse": true in tui.json for click-to-expand on truncated output — with mouse capture on, right-click is swallowed and silently does nothing. Current workarounds are Shift+right-click (terminal-side bypass) and keyboard paste (Ctrl+Shift+V). A right-click-to-paste binding or option in tui.json would fix this properly. opencode 1.18.30.

  4. 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