From 56f7b99fd842f3882943495569a508c5014317d1 Mon Sep 17 00:00:00 2001 From: Brian Krabach Date: Tue, 14 Apr 2026 11:10:15 -0700 Subject: [PATCH] fix: suppress browser context menu on plain right-click in terminal pane --- muxplex/frontend/terminal.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/muxplex/frontend/terminal.js b/muxplex/frontend/terminal.js index f134bb4..b73bfd7 100644 --- a/muxplex/frontend/terminal.js +++ b/muxplex/frontend/terminal.js @@ -472,6 +472,15 @@ function openTerminal(sessionName, remoteId, fontSize) { newPrev.addEventListener('click', _searchPrev); } + // --- Right-click context menu --- + // Suppress the browser context menu on plain right-click inside the terminal + // so tmux's own menu (when `set -g mouse on`) isn't covered by the browser's. + // Shift+RMB and Ctrl+RMB still open the browser context menu as escape hatches. + container.addEventListener('contextmenu', function(e) { + if (e.shiftKey || e.ctrlKey || e.metaKey) return; // let modified clicks through + e.preventDefault(); + }); + connectWebSocket(sessionName, remoteId); initVisualViewport(); /* defined in Task 14 */ }