Workspace transfer reads xterm private state because addon-serialize drops mouse encoding
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- typescript
- Domain
- tooling
Research direction
Start in lib/src/lib/terminal-transfer.ts and run the named round-trip tests in lib/src/lib/terminal-transfer.test.ts, then read docs/specs/transport.md and docs/specs/webgl-text.md for transfer and version-lockstep requirements. Done means addon-serialize emits mouse encoding, the pinned @xterm betas are bumped, the private-state read is removed, and the regression tests pass.
Written by the indexing model from the issue text.
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.
- Dominant language
- TypeScript
- Stars
- 5
- Forks
- 1
- Avg merge
- 17h 45m
- Merged PRs (30d)
- 235
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from diffplug/dormouse
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
security-audit-failure
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
All issues in diffplug/dormouse
Similar issues
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
dennys-bd/agent-hive#184 ·
-
Add: hunch Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
AbdelStark/awesome-typesafe#104 ·
-
ai-observability bug team/ai-observability
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
vicharanashala/fln#563 ·