Workspace transfer reads xterm private state because addon-serialize drops mouse encoding
Personne n'a encore pris cette issue.
- Langage dominant
- TypeScript
- Étoiles
- 5
- Forks
- 1
- Merge moyen
- 18 h 55 min
- PR mergées (30 j)
- 211
Description
Problem
When a Workspace moves between standalone windows, each terminal is rebuilt in the target from @xterm/addon-serialize output (serializeTransferTerminal in lib/src/lib/terminal-transfer.ts). The pinned addon (@xterm/addon-serialize 0.15.0-beta.301, with @xterm/xterm 6.1.0-beta.304) serializes the mouse tracking mode (?1000 / ?1002 / ?1003) but not the mouse encoding: SGR (CSI ? 1006 h) or SGR-pixels (CSI ? 1016 h).
Without it, a full-screen program that turned on SGR mouse reporting (vim, tmux, htop, …) arrives in the new window with xterm's default encoding. From then on its mouse reports are misparsed, and clicks past column 223 cannot be encoded at all.
Current workaround (#630)
serializeTransferTerminal reads xterm's private terminal._core.mouseStateService.activeEncoding and appends \x1b[?1006h or \x1b[?1016h after the serialized buffer. docs/specs/transport.md → "Transferring a Workspace" requires the encoding to survive the move, and lib/src/lib/terminal-transfer.test.ts pins it against real xterm parsing:
preserves mouse tracking and encoding %i through real xterm parsingdoes not resurrect encoding after reset %jstill transfers the buffer if private mouse state is unavailable
The weakness is the private field. If an xterm bump renames or moves mouseStateService / activeEncoding, the lookup returns nothing and the buffer transfers without the encoding. The round-trip tests would fail that bump rather than let it regress silently, but the code still reaches into xterm internals.
Proposed fix
- Upstream: have
addon-serializeemit the active mouse encoding alongside the tracking mode (xtermjs/xterm.js,addons/addon-serialize). - Bump the pinned
@xterm/*betas, respecting the version lockstep indocs/specs/webgl-text.md. - Delete the private-state read in
serializeTransferTerminal; keep the round-trip tests as the regression pin.
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez dans lib/src/lib/terminal-transfer.ts et exécutez les tests round-trip nommés dans lib/src/lib/terminal-transfer.test.ts, puis lisez docs/specs/transport.md et docs/specs/webgl-text.md pour connaître les exigences liées au transfert et à l’alignement des versions. C’est terminé lorsque addon-serialize émet l’encodage de la souris, que les versions bêta épinglées de @xterm sont mises à jour, que la lecture de l’état privé est supprimée et que les tests de régression passent.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- typescript
- Domaine
- tooling
- Type d'issue
- Bug
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- Active
- Clarté
- Plutôt claire
- Accessibilité débutants
- 48/100