feat(site): suppress the web terminal context menu when the application has enabled mouse tracking
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 78/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- react, typescript
Direzione di ricerca
Inizia in site/src/modules/terminal/WorkspaceTerminal.tsx e ispeziona la gestione di contextmenu del wrapper del terminale, il valore xterm terminal.modes.mouseTrackingMode e il Radix ContextMenuTrigger. Verifica che l'input del mouse tracciato sopprima sia i menu nativi sia quelli di Radix, mentre le shell ordinarie mantengano il comportamento del menu specifico della piattaforma.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem
When a TUI that uses mouse reporting (e.g. a coder_app with command = "herdr") runs in the web terminal on macOS, right-clicking opens the browser's native context menu on top of the TUI's own menu. xterm.js forwards the button-3 press to the PTY, so the application handles the click, but nothing suppresses the contextmenu event and the browser menu appears as well.
This is a consequence of a deliberate choice in #26015: site/src/modules/terminal/WorkspaceTerminal.tsx wraps xterm in a Radix ContextMenu with <ContextMenuTrigger asChild disabled={isMac()}>. Windows/Linux get the custom Copy/Paste menu; macOS keeps the native menu because native copy/paste already works there. That is the right default for a plain shell, but wrong when the running application has taken over the mouse. Note the Radix menu on Windows/Linux has the same problem: it opens over the TUI's menu.
There is no escape sequence an application can send to change this; it has to be handled in the frontend.
Proposal
Only show a context menu (native or Radix) when the application has not enabled mouse tracking. xterm.js exposes this via terminal.modes.mouseTrackingMode ('none' | 'x10' | 'vt200' | 'drag' | 'any').
In WorkspaceTerminal.tsx:
- On
contextmenuon the terminal wrapper, ifterminal.modes.mouseTrackingMode !== 'none', callpreventDefault()and let xterm forward the event to the PTY (all platforms). - Otherwise keep the current behaviour: native menu on macOS, Radix Copy/Paste menu elsewhere. For the Radix path this means gating the trigger on mouse tracking as well, not just
isMac().
This matches what VS Code and most desktop terminals do, and keeps the copy/paste affordance for regular shells.
Context
Raised by a customer running a TUI as a coder_app command app whose users are on macOS.
Related: #26015 (custom copy/paste menu), #29564 (per-app icon for the terminal page).
Filed by Coder Agents on behalf of @ericpaulsen.
- Lingua principale
- Go
- Stelle
- 16.6k
- Fork
- 1.6k
- Merge medio
- 1g 23h
- PR unite (30g)
- 543
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di coder/coder
-
bug: AI Gateway client filter lists "Unknown" twice when NULL and literal Unknown clients coexist Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
-
bug frontend
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
-
bug site
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
-
Difficoltà 2/5 Mezza giornata Idoneità per principianti 68/100
Issue simili
-
agentic-workflows
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
agentic-workflows
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
microsoft/agent-framework-go#1179 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
[Bug]: OLLAMA_KEEP_ALIVE="5m" / "24h" crashes Ollama embedding and vision models with ValueError Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
infiniflow/ragflow#20223 · 1 reazione ·
-
bug needs triage pkg/translator/faro
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
open-telemetry/opentelemetry-collector-contrib#51484 · 1 commento ·