Repository navigation
fix: leave right-click to programs that report the mouse - #39
Merged
LukeGus merged 1 commit intoOct 29, 2026
Merged
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
With tmux mouse mode on (or any program that enables mouse reporting), a right-click opens the program's own menu. Termix additionally pasted the clipboard into it, where single characters act as menu shortcuts, or, with right-click copy/paste off, opened the browser context menu on top. When mouse reporting is active the right-click now only goes to the program. Holding Shift keeps the previous behavior, like it does for selecting text.
DL6ER
force-pushed
the
fix/right-click-mouse-tracking
branch
from
October 23, 2026 17:40
8fd9c94 to
54463d8
Compare
|
AI review | Looks safe to merge Adds logic to defer right-click handling to the terminal program when mouse tracking is active, unless Shift is held. Includes tests and follows all repo conventions with no security or rule issues found. Reviewed 54463d8. AI can be wrong, a maintainer still decides. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
With tmux mouse mode on (or any program that turns on mouse reporting), a right-click opens the program's own menu, for example the tmux pane and status bar menus. Termix handled the same click as well:
mmarks the pane,nrenames,Xkills the window or pane. The menu also closed on the first character that did not match.So neither setting gave a usable tmux menu.
This makes the right button belong to the program while it reports the mouse (
terminal.modes.mouseTrackingMode !== "none"): nothing is pasted and the browser menu is suppressed. Holding Shift keeps the previous behavior (paste or copy with the setting on, native menu with it off), the same way Shift forces text selection while a program reports the mouse.Behavior without mouse reporting is unchanged, including Ctrl+right-click for the file manager.
Changes
terminal-clipboard-actions.ts:resolveTerminalContextMenuAction()takesmouseTrackingandshiftKeyand returns a new"app"action in that case.Terminal.tsxandterminal-clipboard.ts(used by the local terminal) pass the two values and onlypreventDefault()on"app".Tradeoff
Anyone who right-clicks to paste inside tmux with mouse on, or in a mouse-reporting TUI, now needs Shift+right-click (or Ctrl+Shift+V). I think the program receiving the click is the better default there, since it already got it, but I can put this behind a setting if you prefer.
Testing
vitestforterminal-clipboardandterminal-clipboard-actions: passing.tsc -p .andprettier --checkare clean. I ran them on Node 22, because the jsdom based test files do not start on Node 20 here.display-menu -Oin the user's tmux.conf avoids that.