fix(terminal): suppress context menu during mouse tracking#730
Draft
IGUNUBLUE wants to merge 1 commit into
Draft
fix(terminal): suppress context menu during mouse tracking#730IGUNUBLUE wants to merge 1 commit into
IGUNUBLUE wants to merge 1 commit into
Conversation
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
Suppress the terminal pane's native browser/WebKit context menu while xterm.js reports that terminal mouse tracking is active.
Closes #721.
Why
TUI apps that enable mouse reporting can receive right-clicks and render their own context menus, but the native Terax/WebKit context menu was still opening on top and blocking the app menu.
How
Terminal.modes.mouseTrackingModeand treat every non-nonemode as terminal-owned mouse input.contextmenulistener on the terminal container and callpreventDefault()only while mouse tracking is active.Testing
pnpm exec tsc --noEmitclean viapnpm check-typespnpm test src/modules/terminal/lib/mouseTracking.test.tspnpm lintran; it reports existing repository warnings outside this change, with no new terminal-file errors from this PRsrc-tauri/)cargo test --lockedandcargo clippy --all-targets --locked -- -D warningsclean#[tauri::command]signature) called out below so the FE caller can be updated in locksteppnpm tauri devScreenshots / GIFs
N/A. This suppresses a native context menu during terminal mouse tracking; no local macOS/WebKit runtime was available for before/after capture.
Notes for reviewer
The change is intentionally scoped to xterm's documented mouse tracking modes (
x10,vt200,drag,any). Native context menus still work whenmouseTrackingModeisnone.