From 5509849473c7549c95b6a3ef87af8075c50d5da7 Mon Sep 17 00:00:00 2001 From: Joe Wilm Date: Mon, 19 Sep 2016 07:59:55 -0700 Subject: Fix bug with OSC string termination Apparently 0x07 is frequently used. Not handling this causes SSH prompts to never appear! --- src/lib.rs | 5 +++++ src/table.rs | 2 +- src/table.rs.in | 4 +++- 3 files changed, 9 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/lib.rs b/src/lib.rs index d66f6bb..9b2c047 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -20,6 +20,11 @@ //! //! Just type `:q` to exit. //! +//! # Differences from original state machine description +//! +//! * UTF-8 Support for Input +//! * OSC Strings can be terminated by 0x07 +//! //! [`Parser`]: struct.Parser.html //! [`Perform`]: trait.Perform.html //! [Paul Williams' ANSI parser state machine]: http://vt100.net/emu/dec_ansi_parser diff --git a/src/table.rs b/src/table.rs index d2034b8..5bb52c0 100644 --- a/src/table.rs +++ b/src/table.rs @@ -290,7 +290,7 @@ pub static STATE_CHANGE: [[u8; 256]; 16] = 255u8, 255u8, 255u8, 255u8, 255u8, 255u8, 255u8, 255u8, 255u8, 255u8, 255u8, 255u8, 255u8, 255u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8], - [112u8, 112u8, 112u8, 112u8, 112u8, 112u8, 112u8, 112u8, 112u8, 112u8, + [112u8, 112u8, 112u8, 112u8, 112u8, 112u8, 112u8, 12u8, 112u8, 112u8, 112u8, 112u8, 112u8, 112u8, 112u8, 112u8, 112u8, 112u8, 112u8, 112u8, 112u8, 112u8, 112u8, 112u8, 0u8, 112u8, 0u8, 0u8, 112u8, 112u8, 112u8, 112u8, 144u8, 144u8, 144u8, 144u8, 144u8, 144u8, 144u8, 144u8, 144u8, diff --git a/src/table.rs.in b/src/table.rs.in index f5a838d..3017e33 100644 --- a/src/table.rs.in +++ b/src/table.rs.in @@ -173,7 +173,9 @@ pub static STATE_CHANGE: [[u8; 256]; 16] = vt_state_table! { }, State::OscString => { - 0x00...0x17 => Action::Ignore, + 0x00...0x06 => Action::Ignore, + 0x07 => State::Ground, + 0x08...0x17 => Action::Ignore, 0x19 => Action::Ignore, 0x1c...0x1f => Action::Ignore, 0x20...0x7f => Action::OscPut, -- cgit