microsoft / microsoft/tui-test

Snapshot box misaligns for rows holding emoji sequences

Open
#92 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
267
Forks
24
Avg merge
3d 19h
Merged PRs (30d)
50

Description

A snapshot frame is drawn to the grid's column count, but the grid measures a character at a time while a terminal renders an emoji sequence as one glyph. A row holding one comes out narrower than its frame.

Reproducing, with no window title involved:

```
Str-width= 14 ╭────────────╮
Str-width= 8 │👨‍👩‍👧‍👦ab │ ← six columns short
Str-width= 14 │ │
Str-width= 14 ╰────────────╯
```

The grid puts that family emoji in 8 columns (one cell plus 4 continuations) because `alacritty_terminal` measures with `UnicodeWidthChar` per character. A terminal draws it in 2, which is what `UnicodeWidthStr` reports for the whole string. The same gap affects skin-tone modifiers, keycaps, and a base character followed by a variation selector.

Measured on `unicode-width` 0.2.2:

| sequence | per character | whole string |
| --- | --- | --- |
| `👨‍👩‍👧‍👦` | 8 | 2 |
| `👍🏽` | 4 | 2 |
| `1️⃣` | 1 | 2 |
| `❤️` | 1 | 2 |

This predates #91 and is independent of it: #91 only made the *title* measure whole strings, since it is a string we place rather than grid content. Fixing the rows means changing how the grid assigns cells to a sequence, which is a decision about the emulator seam rather than about the serializer, and would want the same treatment in every backend.

Worth deciding whether shell-use follows its emulator here or groups sequences itself before the two disagree somewhere more visible than a snapshot border.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file or test path is named. Start at the grid’s per-character cell assignment and the alacritty_terminal UnicodeWidthChar measurement, then reproduce the family-emoji snapshot case. Done requires an agreed treatment for emoji sequences that keeps snapshot borders aligned consistently across backends.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli, testing-qa
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.