term: reset more state on RIS full reset

When a program turns on modifyOtherKeys and exits uncleanly, it can
leave ctrl keys emitting escape sequences the shell doesn't understand.
The obvious recovery is the "Reset the terminal emulation state in the
current pane" command in the command palette, which sends RIS.  However,
RIS wasn't clearing modifyOtherKeys, so it didn't help. This commit
fixes RIS to reset that state, and a sweep for the same kind of
omission turned up missing resets for left/right margin mode and bidi
overrides, which it now resets too. This brings RIS in line with the
state a soft reset (DECSTR) already clears.
This commit is contained in:
Wez Furlong committed 2026-08-12 07:01:21 +01:00
1 parent e723cf5005
commit fe3006aefc
2 files changed
+8

No files matched your search

+4
View File
@@ -152,6 +152,10 @@ As features stabilize some brief notes about them will accumulate here.
search matching. Thanks to @mrdziuban! #7385
#### Fixed
* `ResetTerminal` (RIS) did not reset the `modifyOtherKeys` state. A program
that left it enabled and exited uncleanly could leave ctrl keys emitting
escape sequences that the shell doesn't expect. RIS now also resets the
left/right margin mode and bidi state.
* Race condition when very quickly adjusting font scale, and other improvements
around resizing. Thanks to @jknockel! #4876 #5032 #5033
* macOS: wacky initial window size with external monitors or certain font
+4
View File
@@ -698,6 +698,7 @@ impl<'a> Performer<'a> {
self.mouse_tracking = false;
self.mouse_encoding = MouseEncoding::X10;
self.keyboard_encoding = KeyboardEncoding::Xterm;
self.modify_other_keys = None;
self.sixel_scrolls_right = false;
self.any_event_mouse = false;
self.button_event_mouse = false;
@@ -711,6 +712,9 @@ impl<'a> Performer<'a> {
self.palette.take();
self.top_and_bottom_margins = 0..self.screen().physical_rows as VisibleRowIndex;
self.left_and_right_margins = 0..self.screen().physical_cols;
self.left_and_right_margin_mode = false;
self.bidi_enabled.take();
self.bidi_hint.take();
self.unicode_version = self.config.unicode_version();
self.unicode_version_stack.clear();
self.suppress_initial_title_change = false;