Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

feat(site): suppress the web terminal context menu when the application has enabled mouse tracking

Aperta Adatta ai principianti
#29,565 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

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
Ambito
frontend, web-dev

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 contextmenu on the terminal wrapper, if terminal.modes.mouseTrackingMode !== 'none', call preventDefault() 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

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di coder/coder

Tutte le issue di coder/coder

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.