From ff09e393090ebe1ac01322823e3b1fe373a253bf Mon Sep 17 00:00:00 2001 From: Christian Duerr Date: Sat, 15 Feb 2020 20:00:53 +0000 Subject: [PATCH] Fix parser stopping at unknown modes This resolves an issue in the parser where it would stop as soon as the first unknown value is encountered in private mode/sgr attribute escapes. Fixes #3339. --- CHANGELOG.md | 1 + alacritty_terminal/src/ansi.rs | 16 ++++------------ 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b4a3ec1..2545d393 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -51,6 +51,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Modifier key combinations like `Ctrl + Q` not generating characters on macOS - Handling of URLs with single quotes - Parser reset between DCS escapes +- Parser stopping at unknown DEC private modes/SGR character attributes ### Removed diff --git a/alacritty_terminal/src/ansi.rs b/alacritty_terminal/src/ansi.rs index 0877fbff..a554ab72 100644 --- a/alacritty_terminal/src/ansi.rs +++ b/alacritty_terminal/src/ansi.rs @@ -893,6 +893,7 @@ where } } + #[allow(clippy::cognitive_complexity)] #[inline] fn csi_dispatch( &mut self, @@ -1022,10 +1023,7 @@ where for arg in args { match Mode::from_primitive(intermediate, *arg) { Some(mode) => handler.unset_mode(mode), - None => { - unhandled!(); - return; - }, + None => unhandled!(), } } }, @@ -1044,10 +1042,7 @@ where for arg in args { match Mode::from_primitive(intermediate, *arg) { Some(mode) => handler.set_mode(mode), - None => { - unhandled!(); - return; - }, + None => unhandled!(), } } }, @@ -1058,10 +1053,7 @@ where for attr in attrs_from_sgr_parameters(args) { match attr { Some(attr) => handler.terminal_attribute(attr), - None => { - unhandled!(); - return; - }, + None => unhandled!(), } } }