diff options
author | Christian Duerr <contact@christianduerr.com> | 2021-02-21 20:57:02 +0100 |
---|---|---|
committer | Christian Duerr <contact@christianduerr.com> | 2021-02-21 21:58:09 +0000 |
commit | 59bb331d5e702a4cb608636d4b8b534a3903f7bb (patch) | |
tree | 288281113f3a220b90780dbd633f4e93916fecb1 | |
parent | 8a0c57bbc0dd648f7a3cb80e48e8e2387641bbb8 (diff) | |
download | r-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.rs | 32 |
1 files changed, 15 insertions, 17 deletions
@@ -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 |