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

Abierto
#7,938 3 comentarios 2 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@sumitjhacodes ya está trabajando en esto.

Desde el 11/9/2026.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
48/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
typescript, vscode

Línea de trabajo

Comienza rastreando la integración del terminal de code-server y su uso de la compilación distribuida de @xterm/xterm 6.1.0-beta.291; después, compara cómo podría configurarse mouseEventsRequireAlt. Consulta las preguntas frecuentes del terminal para encontrar la vía de escape Shift+drag. Se considera completado cuando los usuarios del navegador pueden conservar la selección del terminal mientras los informes del ratón siguen disponibles, o cuando la limitación y el workaround están documentados.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
TypeScript
Estrellas
79.9k
Forks
6.9k
Merge medio
20 h 21 min
PR fusionados (30 d)
51

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de coder/code-server

Todos los issues de coder/code-server

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.