fix: suppress browser context menu and prevent trackpad tap from dism…#1520
Open
aaradhyaberisfdc wants to merge 1 commit intotsl0922:mainfrom
Open
fix: suppress browser context menu and prevent trackpad tap from dism…#1520aaradhyaberisfdc wants to merge 1 commit intotsl0922:mainfrom
aaradhyaberisfdc wants to merge 1 commit intotsl0922:mainfrom
Conversation
…issing tmux menus When mouse tracking is active, suppress the browser context menu and filter SGR mouse reports so that a quick Mac trackpad two-finger tap doesn't instantly dismiss tmux's right-click menu. Shift+right-click bypasses to show the browser's native menu.
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.
Problem
When using ttyd with tmux (
set -g mouse on), right-clicking to open tmux's context menu has two issues:Additionally, no-button motion events (
code & 3 === 3) sent after the release tell tmux "no button is held", which also dismisses the menu.Fix
Three-layer interception:
contextmenuhandler: suppresses the browser menu during mouse tracking. Shift+right-click bypasses to show the browser's native menu.mouseupcapture handler: blocks the right-button release at document level before xterm.js can generate a report.onDataSGR filter: drops right-button release and no-button motion reports while the filter is active. Resets on non-right-button press (user selecting a menu item) or after a safety timeout.All three are no-ops when mouse tracking is off (normal shell usage).
Testing
With
set -g mouse onin tmux: