Terminal loses text selection whenever a TUI enables mouse reporting — no way to opt out in the browser

Aperta
#7,938 3 commenti 2 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@sumitjhacodes ci sta già lavorando.

Dal 11/9/2026.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
typescript, vscode

Direzione di ricerca

Inizia tracciando l’integrazione del terminale di code-server e il suo utilizzo della build distribuita di @xterm/xterm 6.1.0-beta.291, quindi confronta come potrebbe essere configurato mouseEventsRequireAlt. Controlla le FAQ del terminale per trovare la via d’uscita Shift+drag. Il lavoro è completato quando gli utenti del browser possono mantenere la selezione del terminale mentre la gestione degli eventi del mouse rimane disponibile, oppure quando la limitazione e il workaround sono documentati.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug code-server needs-investigation
What happens

Any TUI that enables mouse reporting (CSI ? 1000 h) takes the click away from xterm.js, so a plain drag in the terminal no longer creates a selection. On the desktop that is annoying; in code-server it removes the last reliable path to the OS clipboard, because the DOM selection is what the browser's own copy relies on — the VS Code copy commands go through an async IPC hop that loses the clipboard user-gesture.

Concretely: with a full-screen TUI running (e.g. Claude Code with tui: fullscreen), users cannot copy terminal text out of the browser at all, unless they know that Shift+drag forces a selection.

Measured

Loaded the exact @xterm/xterm build shipped by code-server (6.1.0-beta.291) standalone and drove it with real mouse events:

Mouse tracking armed plain drag Shift + drag
none selection selection
?1000h ?1006h nothing selection
?1000h ?1002h ?1003h ?1006h nothing selection
Ask

xterm.js already has the option that solves this — mouseEventsRequireAlt, which keeps tracking armed but only claims the click while a modifier is held. It is not referenced anywhere in the VS Code build that code-server ships, so it stays at its default.

I have opened an upstream request for VS Code to expose it as a terminal setting: https://github.com/microsoft/vscode/issues/330052. Filing here as well because the browser case is materially worse than the desktop one, and because code-server may want to set the option (or surface a preference) ahead of upstream.

At minimum, documenting Shift+drag as the escape hatch in the terminal FAQ would already help.

Lingua principale
TypeScript
Stelle
79.9k
Fork
6.9k
Merge medio
20h 21m
PR unite (30g)
51

Preparare l'ambiente

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/code-server

Tutte le issue di coder/code-server

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.