From 3426f4a1a9394af01fe7c6319df5c4e1240f8a1f Mon Sep 17 00:00:00 2001 From: Joe Wilm Date: Sat, 23 Jul 2016 12:37:18 -0700 Subject: Fix bug getting stuck in non-CSI escapes Escapes terminated by a bell were not properly handled. --- src/ansi.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/ansi.rs b/src/ansi.rs index 496f87d0..46f0b638 100644 --- a/src/ansi.rs +++ b/src/ansi.rs @@ -734,7 +734,14 @@ impl Parser { C0::LF | C0::VT | C0::FF => handler.linefeed(), - C0::BEL => handler.bell(), + C0::BEL => { + // Clear ESC state is in an escape sequence. + if let State::EscapeOther = self.state { + self.state = State::Base; + } + + handler.bell(); + }, C0::ESC => { self.csi_reset(); self.state = State::Escape; -- cgit v1.2.3-54-g00ecf