Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

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

Aberta
#7,938 3 comentários 2 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
48/100
Tipo de issue
Funcionalidade
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
typescript, vscode

Direção de pesquisa

Comece rastreando a integração do terminal do code-server e o uso que ela faz do build distribuído do @xterm/xterm 6.1.0-beta.291; em seguida, compare como mouseEventsRequireAlt poderia ser configurado. Consulte as perguntas frequentes do terminal para verificar a alternativa Shift+drag. Considera-se concluído quando os usuários do navegador conseguem preservar a seleção do terminal enquanto o relatório do mouse continua disponível, ou quando a limitação e o workaround estão documentados.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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.

Linguagem predominante
TypeScript
Estrelas
79.5k
Forks
6.9k
Merge médio
2d 13h
PRs com merge (30d)
41

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de coder/code-server

Todas as issues de coder/code-server

Issues semelhantes

Mais issues de TypeScript

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.