diff --git a/docs/changelog.md b/docs/changelog.md index dd95f31ec..e3eeb945a 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -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 diff --git a/term/src/terminalstate/performer.rs b/term/src/terminalstate/performer.rs index 4acbe6cff..25cdec6a5 100644 --- a/term/src/terminalstate/performer.rs +++ b/term/src/terminalstate/performer.rs @@ -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;