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.
This commit is contained in:
Wez Furlong committed 2020-06-20 11:12:18 -07:00
1 parent b69c9b1c70
commit fded650ccb
1 file changed
+17 -1
+17 -1
View File
@@ -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