Repository navigation
fix(emu): measure text in grid columns, group SGR 58, honour ?7h - #609
Merged
Merged
Conversation
- A new width module lays text out as vt100 0.18 does: each character its own width, a zero-width one joining the cell before it, and the presentation selector widening an emoji. Insert mode, Screen::locate, the diff frame and the text reader use it; each measured a run as a string, which a ZWJ family, lam-alef and a skin-toned emoji are not (#580). The reader falls back to one column per selector cell when a row only fits that way, which is how earlier releases wrote it. - The grid's colour normalizer turns a semicolon-form underline colour (58;5;n, 58;2;r;g;b) into one colon parameter, so vt100 skips it whole instead of taking its arguments for attributes (#579). - CSI ? 7 h asks for the only behaviour the emulator has and is no longer recorded as unsupported; CSI ? 7 l still is (#581). Signed-off-by: Vyncint Ng <115854244+vyncint@users.noreply.github.com>
LIMITATIONS.md names the insert run that wraps at the margin, autowrap off, and the wide character that wraps unrecorded over an empty last column (#585); DESIGN.md section 3 gives the reader's width rule. Signed-off-by: Vyncint Ng <115854244+vyncint@users.noreply.github.com>
vyncint
added a commit
that referenced
this pull request
Oct 27, 2026
Resolves the CHANGELOG conflict with #609: both sets of entries kept. Signed-off-by: Vyncint Ng <115854244+vyncint@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Four emulator-front issues, on top of vt100 0.18.1 (#608).
#580 — text measured in the grid's columns. A new
width::columnslays text out exactly as vt100 0.18 does: each character its own width, a zero-width one joining the cell before it, and the presentation selector widening an emoji. Neitherunicode-widthmeasure is that — a ZWJ family is one 2-column cluster toUnicodeWidthStrbut two wide cells on the grid;⚠️is 1 column to a per-character sum but 2 on the grid. A test holds the model against vt100 itself for ten samples (CJK, combining, lam-alef, ZWJ, VS16, keycap, skin tone, flags). Used by:AB, lam-alefA);Screen::locate(reported history column 3 for text at column 5);termlens diffframe padding;⚠️reads back with the columns it was written at. Releases before this one gave it one column and the text does not say which wrote it: a row that only fits at one column per such cell reads the earlier way, so no file an earlier release wrote stops parsing.An inserted run that wraps at the margin still overwrites the next row: doing it right needs the scroll region and origin mode, which termlens does not track. Documented in LIMITATIONS.md.
#579 — SGR 58. The grid's normalizer turns
58;5;n/58;2;r;g;binto one colon parameter, which vt100 skips whole instead of reading5as blink andnas an attribute (58;5;0reset the cell,58;5;1made it bold). Still recorded byunsupported(), as^[[58:5:1m; the allocation-free fast path for plain SGRs is kept.#581 —
CSI ? 7 his no longer recorded: it asks for autowrap, the emulator's only behaviour.?7lis still recorded; LIMITATIONS.md says autowrap cannot be turned off.#585 — documented, as the issue allows: vt100 records a wrap only where the last column held something, and a real fix needs per-row wrap state that survives scrolling, which vt100 has no API for.
Screen::row_wrappedand LIMITATIONS.md now say so, with the issue's example.Verification. Each fix has a test, and reverting it fails that test (insert mode,
locate, the pad and the reader each to the string measure; the 58 grouping disabled). Full workspace suite, clippy, rustdoc-D warnings, DCO and attribution gates pass locally. No new PTY-spawning tests.Closes #579
Closes #580
Closes #581
Closes #585