microsoft / microsoft/tui-test

xterm.js backend: revisit addon-unicode-graphemes and addon-clipboard (OSC 52)

Open
#175 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
267
Forks
24
Avg merge
3d 19h
Merged PRs (30d)
50

Description

Tracking the two `@xterm` addons the xterm.js backend deliberately does not use yet, moved out of `crates/tui-test/assets/xtermjs/README.md` so the vendoring notes stay short.

### `@xterm/addon-unicode-graphemes`

Would replace the pinned `@xterm/addon-unicode11`. Not adopted because it:

- is marked experimental by its own package description,
- needs an `atob` the QuickJS host does not provide, and
- measures two cases differently from alacritty:

| Input | alacritty | v11 (pinned) | v15-graphemes |
| ----- | --------- | ------------ | ------------- |
| `👨‍👩X` | 5 | 5 | 3 |
| `👍🏽X` | 5 | 5 | 3 |

Agreeing with alacritty on width is why unicode11 is pinned where it is: a disagreement puts every cell after an emoji in a different column on the two backends, which moves what `cells`, the locator, and the SVG renderer report.

**Revisit when** it is no longer experimental, and adopt only if it still agrees with alacritty on that table.

### `@xterm/addon-clipboard`

Implements `OSC 52`, which tui-test does not support on any backend today — alacritty parses it and raises `ClipboardStore`/`ClipboardLoad`, and the listener in `terminal/alacritty.rs` drops both.

Adding it to xterm.js alone would make things worse rather than better: `OSC 52;c;?` is answered by nothing today, and this would make one backend answer it, so the same sequence would behave differently depending on the selected backend.

**Order matters here:** `OSC 52` should land in the `Emulator` contract and the conformance suite first; this addon is then how xterm.js implements its half.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the vendoring notes in crates/tui-test/assets/xtermjs/README.md and the OSC 52 handling in terminal/alacritty.rs. Read the Emulator contract and conformance suite before considering addon-clipboard; verify that OSC 52 behaves consistently across backends. Revisit addon-unicode-graphemes only when it is no longer experimental and still matches alacritty's widths in the listed cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, rust
Domain
backend, cli, testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.