summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Duerr <contact@christianduerr.com>2020-02-15 20:00:53 +0000
committerGitHub <noreply@github.com>2020-02-15 20:00:53 +0000
commitff09e393090ebe1ac01322823e3b1fe373a253bf (patch)
treec11ca37b18907ea7737afeba61d7b4cf4d2838c5
parenta842d6827c74108156f0f21e34ff93c2a7a349fb (diff)
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.
-rw-r--r--CHANGELOG.md1
-rw-r--r--alacritty_terminal/src/ansi.rs16
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!(),
}
}
}