aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Duerr <contact@christianduerr.com>2021-02-21 20:57:02 +0100
committerChristian Duerr <contact@christianduerr.com>2021-02-21 21:58:09 +0000
commit59bb331d5e702a4cb608636d4b8b534a3903f7bb (patch)
tree288281113f3a220b90780dbd633f4e93916fecb1
parent8a0c57bbc0dd648f7a3cb80e48e8e2387641bbb8 (diff)
downloadr-alacritty-vte-59bb331d5e702a4cb608636d4b8b534a3903f7bb.tar.gz
r-alacritty-vte-59bb331d5e702a4cb608636d4b8b534a3903f7bb.tar.bz2
r-alacritty-vte-59bb331d5e702a4cb608636d4b8b534a3903f7bb.zip
Fix intermediate reset when going from DCS to ESC
This resolves a bug when transitioning between DCS and ESC sequences, which would cause the intermediates of the ESC dispatch to contain data from the DCS sequence.
-rw-r--r--src/lib.rs32
1 files changed, 15 insertions, 17 deletions
diff --git a/src/lib.rs b/src/lib.rs
index b6d2658..9d7931f 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -165,28 +165,26 @@ impl Parser {
match self.state {
State::DcsPassthrough => {
self.perform_action(performer, Action::Unhook, byte);
- maybe_action!(action, byte);
},
State::OscString => {
self.perform_action(performer, Action::OscEnd, byte);
- maybe_action!(action, byte);
},
- _ => {
- maybe_action!(action, byte);
-
- match state {
- State::CsiEntry | State::DcsEntry | State::Escape => {
- self.perform_action(performer, Action::Clear, byte);
- },
- State::DcsPassthrough => {
- self.perform_action(performer, Action::Hook, byte);
- },
- State::OscString => {
- self.perform_action(performer, Action::OscStart, byte);
- },
- _ => (),
- }
+ _ => (),
+ }
+
+ maybe_action!(action, byte);
+
+ match state {
+ State::CsiEntry | State::DcsEntry | State::Escape => {
+ self.perform_action(performer, Action::Clear, byte);
+ },
+ State::DcsPassthrough => {
+ self.perform_action(performer, Action::Hook, byte);
+ },
+ State::OscString => {
+ self.perform_action(performer, Action::OscStart, byte);
},
+ _ => (),
}
// Assume the new state