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.
This commit is contained in:
Christian Duerr 2020-02-15 20:00:53 +00:00 committed by GitHub
parent a842d6827c
commit ff09e39309
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 12 deletions

View File

@ -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

View File

@ -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!(),
}
}
}