Repository navigation
fix: eight v0.11.12 emulator issues (IND/NEL, DECRQM, OSC lists, designations) - #887
Merged
Merged
Conversation
vte hands an omitted parameter on as 0, and the record dropped that 0 only when it was the sole parameter, so `CSI 22 ; t` was listed as `^[[22;0t` and `CSI ; 5 h` as `^[[0;5h`, with a 0 the application never wrote. The tracker now notes which parameters of a CSI had nothing written in them, and the emulator tells the record so between the bytes before the final byte and that byte, fed alone, as it does for the `SP` intermediates (#764). The record leaves those parameters empty. A `0` the application wrote is still listed. Closes #827 Signed-off-by: Vyncint Ng <115854244+vyncint@users.noreply.github.com>
vt100 returns from the whole SGR when an extended colour's index or channel does not fit a byte, so in `CSI 38;5;256;1 m` the bold was lost, and nothing was listed in `Screen::unsupported()`. xterm's `parse_extended_colors` consumes the colour's values, leaves the colour as it was, and goes on to the next parameter. The colour normalizer in front of vt100 now drops such a colour, in the semicolon and the colon form, so the parameters after it apply. An SGR left with no parameter becomes a stand-in vte ignores, since an empty SGR would be a reset. Closes #823 Signed-off-by: Vyncint Ng <115854244+vyncint@users.noreply.github.com>
vt100 has no arm for `ESC D` or `ESC E`, and the tracker ended them as plain two-character escapes, so the text after either went on along the row it meant to leave and `Screen::unsupported()` listed both. The xterm-256color entry every child is handed advertises `nel`. xterm's `CASE_IND` is `xtermIndex`, which is what a line feed does, and `CASE_NEL` is that and a carriage return. The tracker now reports both, and the emulator hands vt100 a CSI vte ignores in place of the final byte, as it does for REP, then feeds both parsers the line feed (with a CR for NEL), which scrolls at the bottom margin. The unsupported() tests that used `ESC D` as an escape nobody honours use `ESC 6` now. Closes #816 Signed-off-by: Vyncint Ng <115854244+vyncint@users.noreply.github.com>
On a change of size the tracker cleared both screens' margins and kept origin mode, following vt100. xterm's ScreenResize clears both together (`resetMargins(xw); UIntClr(*flags, ORIGIN);`), so after a resize and a new region, `CUP 1;1` drew at the region's top here and at the screen's corner in xterm. The tracker now clears origin mode on both screens with the margins and says which had it on. The emulator resets it in those vt100 grids with `CSI ? 6 l`, putting a hidden grid on display for it as the resize does, and moves the cursor back where it was, since vt100 homes it. Being bytes, the reset waits while the stream is inside a sequence and is carried out where that sequence ends. Closes #826 Signed-off-by: Vyncint Ng <115854244+vyncint@users.noreply.github.com>
The tracker classified `CSI Ps $ p` as a question it cannot answer, so an application that asked for an ANSI mode got no reply and waited out its own timeout, though xterm answers every ANSI-mode request (`do_ansi_rqm`, misc.c 5408). And `CSI ? 6 $ p` reported origin mode as not recognized, though the tracker follows it per screen and the position report reads it. The request is now its own query, answered from a new emulator method: insert mode from the tracker, every other ANSI mode "not recognized", as an unknown private mode already is. `mode_state` reports mode 6 from the tracker. The responder in terminal.rs gains the one arm that writes the reply, and the shape a timeout would name. Closes #830 Signed-off-by: Vyncint Ng <115854244+vyncint@users.noreply.github.com>
Since #693 a reset of any of 9, 1000, 1002 and 1003 turns reporting off, and click, drag, scroll and mouse_move refuse. The reset took out only the mode it named from the requested set DECRQM answers from, so after `?1003h ?1000l` DECRQM said any-event tracking was on while termlens's own input path sent nothing. xterm sets `MOUSE_OFF` on a reset of any of the four, and its DECRQM then answers each one reset. The tracker now empties the set on such a reset, so DECRQM answers 2 for every tracking mode until one is set again, and `Screen::mouse_modes()` stops listing a mode nothing reports in. The tests that pinned the old rule, and the rustdoc and DESIGN text that stated it, follow. DECRQM while two modes are both set is #151's design and is left as it is. Closes #832 Signed-off-by: Vyncint Ng <115854244+vyncint@users.noreply.github.com>
The tracker took an OSC colour string as a query only when its whole body was `10;?`, `11;?` or `12;?`, and had no arm for `ESC Z`. So `OSC 10;?;?`, `OSC 17;?`, `OSC 10;?;rgb:…` and `ESC Z` got no reply and were not named in a timeout, though xterm answers each: OSC 10 to 19 go to `ChangeColorsRequest`, which answers each `?` for the code it stands at, and `CASE_DECID` falls through to `CASE_DA1`. An OSC 10 to 19 string is now read as a list from its code. The foreground and background are answered wherever they stand, as they were alone; from 10 or 11 they come first, so the replies are in the order asked. Any other colour asked for is named in the next timeout. `ESC Z` is answered with the DA1 reply. The record leaves these out as the responder's, and still lists a string that also sets a colour, which nobody models. The responder in terminal.rs gains the arms that write the replies and name a list's remainder. Closes #833 Signed-off-by: Vyncint Ng <115854244+vyncint@users.noreply.github.com>
The tracker designated a set only after a single intermediate of `(`, `)`, `*` or `+`. A second intermediate cleared it, and `-`, `.` and `/` named no slot, so `ESC ( % 5` and `ESC - A` changed nothing: a slot holding DEC Special Graphics went on drawing lines, and both were listed in `Screen::unsupported()`. xterm's `xtermDecodeSCS` replaces the slot for each designation its tables take. The tracker now reads `ESC - A`, `ESC . A` and `ESC / A` as G1 to G3, and `ESC ( % F` (and the `)`, `*`, `+` forms) for the finals xterm's `scs_pct_table` takes (`0`, `2`, `3`, `5`, `6`, `=`), each as a set read as ASCII, as LIMITATIONS says of every designation but `0` and `A`. The finals xterm does not take at its default VT420 level, and the VT5xx `"` and `&` sets, still change nothing. The record leaves out the forms the tracker takes. Closes #824 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.
Eight emulator issues from the v0.11.12 milestone, one commit each, each with tests that fail without the fix.
unsupported()lists an empty CSI parameter as written (^[[22;t), not as an invented0. The tracker hands the record the empty-parameter mask before the final byte, as A CSI with a space intermediate (CSI 2 SP @, scroll left) is listed as a different sequence, or not at all #764 does for the intermediates.38;5;256) drops the rest of the SGR, andunsupported()stays empty #823: an extended colour (38/48, either form) with an index or channel past 255 is dropped before vt100 reads the SGR, so the parameters after it apply, as xterm skips them.ESC E) and IND (ESC D) are ignored, though the xterm-256color termlens sets advertisesnel#816: IND (ESC D) and NEL (ESC E) are carried out as LF and CR LF in both parsers, scrolling at the bottom margin.ScreenResizedoes, and the cursor stays put.CSI Ps $ p) is answered: IRM from the tracker, every other mode 0.CSI ? 6 $ preports origin mode from the tracker.MOUSE_OFFdoes. This is a Changed entry, with a migration sentence. Three tests that pinned the old rule are updated.OSC 10;?;?,OSC 17;?andESC Zare neither answered nor named in the timeout; xterm answers them #833: anOSC 10–19string is read as a list. 10 and 11 are answered wherever they appear, and 12–19 are named.ESC Z(DECID) is answered as DA1.%designation (ESC - A,ESC ( % 5) keeps the previous set in force; xterm replaces it #824:ESC - A/ESC . A/ESC / AandESC ( % 5and the like replace the designated set, read as ASCII, using the finals xterm takes at its default VT level.terminal.rs gains only responder arms for #830 and #833; the rest is
src/emu/, tests and docs (DESIGN, LIMITATIONS, screen.rs rustdoc).Not fixed, noted while working: at a pending wrap, vt100's line feed leaves the wrap pending (
abcdefghijLFXon 10 columns putsXat row 2). This looks like #814's family, but it has not been checked against xterm yet, so it is not filed.Local:
cargo test --workspace --all-features --no-fail-fastpasses, and fmt and clippy are clean. Stress is dispatched.Closes #827
Closes #823
Closes #816
Closes #826
Closes #830
Closes #832
Closes #833
Closes #824