From fded650ccbac1aefb132d4c11d8db8e6ac2daad1 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Sat, 20 Jun 2020 11:11:54 -0700 Subject: [PATCH] term: add DECRQSS DECSLRM response While testing this with esctest, it was apparent that xterm deviates from the DEC docs by allowing a minimum region size smaller than 2, so adjust our restriction accordingly. --- term/src/terminalstate.rs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/term/src/terminalstate.rs b/term/src/terminalstate.rs index ebacfe6f8..42686d644 100644 --- a/term/src/terminalstate.rs +++ b/term/src/terminalstate.rs @@ -2013,10 +2013,13 @@ impl TerminalState { return; } - // The minimum size of the scrolling region is two columns. + // The minimum size of the scrolling region is two columns per DEC, + // but xterm allows 1. + /* if right - left < 2 { return; } + */ self.left_and_right_margins = left..right + 1; @@ -2535,6 +2538,19 @@ impl<'a> Performer<'a> { ) .ok(); } + &[b's'] => { + // DECSLRM - left and right margins + let margins = self.left_and_right_margins.clone(); + write!( + self.writer, + "{}1$r{};{}s{}", + DCS, + margins.start + 1, + margins.end, + ST + ) + .ok(); + } _ => { log::error!("unhandled DECRQSS {:?}", s); // Reply that the request is invalid