Skip to content
Merged
52 changes: 52 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,32 @@ reads that marker.

### Changed

- An `OSC 10` to `OSC 19` string is read as xterm reads it, each `?`
asking for the colour of the code it stands at: `OSC 10 ; ? ; ?` gets
the foreground and the background replies, in that order, and
`OSC 10 ; ? ; rgb:…` the foreground's. The colours termlens does not
hold (12 to 19) are named in the next timeout, alone (`OSC 17 ; ?`) or
after the ones answered (`OSC 11 ; ? ; ?`). And `ESC Z` (DECID) gets
the DA1 reply, as in xterm. Each got no reply and no name, so a
program blocked on one waited out the test's timeout undiagnosed. A
test that expected one of these strings in `Screen::unsupported()`
should expect the reply or the timeout's note; a string that also sets
a colour is still listed. (#833)
- A reset of any mouse tracking mode (`CSI ? 9 l`, `? 1000 l`,
`? 1002 l`, `? 1003 l`) empties the set `Screen::mouse_modes()`
reports, and DECRQM answers every tracking mode reset until one is set
again, as xterm's one tracking mode is then off. The reset took out
only the mode it named, so after `CSI ? 1003 h CSI ? 1000 l` DECRQM
reported 1003 set while termlens itself sent no mouse report. A test
that expected the modes a reset did not name in `mouse_modes()` should
expect an empty set. (#832)
- ANSI-mode DECRQM (`CSI Ps $ p`) is answered, as xterm answers it:
insert mode (`CSI 4 $ p`) reports set or reset, and every other ANSI
mode `0`, not recognized. It got no reply, so a program that asked
waited out its own timeout, which named the request. And `CSI ? 6 $ p`
reports origin mode set or reset, where it reported `0` though the
mode is followed per screen. A test that expected `^[[4$p` in a
timeout's note should expect the reply. (#830)
- DA1 and DA2 are answered whatever follows a first parameter of 0
(`CSI 0;1 c`, `CSI > 0;1 c`), as xterm answers them by that parameter
alone. They got no reply, so a program that asked that way waited out
Expand Down Expand Up @@ -79,6 +105,32 @@ reads that marker.

### Fixed

- A 96-character designation (`ESC - A`, `ESC . A`, `ESC / A`) and a
`%` one (`ESC ( % 5` and the other finals xterm takes at its default
level) replace the set in their slot and read as ASCII, as
`docs/LIMITATIONS.md` says of every designation but `0` and `A`. They
kept the previous set, so a program that left line drawing that way
went on drawing box characters, and `Screen::unsupported()` listed
them. (#824)
- A change of size ends origin mode (`DECOM`) with the scroll margins, as
xterm's resize does, and leaves the cursor where it was. Origin mode
stayed on, so once the program set a new region, `CUP 1;1` drew at
that region's top row rather than the screen's corner. (#826)
- IND (`ESC D`) and NEL (`ESC E`) are carried out, as xterm carries them
out: IND moves the cursor down a row and NEL to the start of the next,
each scrolling at the bottom margin as a line feed does. Both were
ignored, so the text after `tput nel` went on along the same row, and
`Screen::unsupported()` listed `^[D` and `^[E`. (#816)
- An extended colour with an index or a channel past 255 (`38;5;256`,
`48;2;300;0;0`, either form) is ignored and the rest of the SGR
applies, as xterm applies it: `CSI 38;5;256;1 m` draws bold and keeps
the colour in force. Every parameter after such a colour was lost, and
`Screen::unsupported()` named nothing. (#823)
- `Screen::unsupported()` lists a parameter the application left empty
as empty: `CSI 22 ; t` is `^[[22;t`, `CSI ; 5 h` is `^[[;5h`. Every
empty parameter but a sole one was listed as a `0` the application
never wrote. A `0` it wrote is still listed. A test that expected
`^[[22;0t` for `CSI 22 ; t` should expect `^[[22;t`. (#827)
- An empty regex match at the end of a row is reported one past the
last cell the text covers, by one rule for every row, as `find` reports
a match after a wide character: on six columns `find_all_matches($)`
Expand Down
7 changes: 7 additions & 0 deletions crates/termlens/src/emu/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,13 @@ pub(crate) trait Emulator: Send {
/// Whether DEC private mode `mode` is set, for answering `DECRQM`.
fn mode_state(&self, mode: u32) -> ModeState;

/// Whether ANSI mode `mode` is set, for answering the ANSI form of
/// `DECRQM` (`CSI Ps $ p`). "Not recognized" unless the emulator holds
/// the mode exactly, as for [`mode_state`](Self::mode_state).
fn ansi_mode_state(&self, _mode: u32) -> ModeState {
ModeState::NotRecognized
}

/// Resize the emulated grid to `rows` × `cols`.
fn set_size(&mut self, rows: u16, cols: u16);
}
Loading
Loading