diff --git a/parserstate.cpp b/parserstate.cpp index 37ea192..ea6be4c 100644 --- a/parserstate.cpp +++ b/parserstate.cpp @@ -149,7 +149,7 @@ Transition CSI_Entry::input_state_rule( wchar_t ch ) return Transition( new Param, &family->s_CSI_Param ); } - if ( (ch <= 0x3C) && (ch <= 0x3F) ) { + if ( (0x3C <= ch) && (ch <= 0x3F) ) { return Transition( new Collect, &family->s_CSI_Param ); } diff --git a/terminal.cpp b/terminal.cpp index 2e62c9a..57bcc09 100644 --- a/terminal.cpp +++ b/terminal.cpp @@ -67,18 +67,15 @@ std::string Emulator::input( char c, int actfd ) if ( (actfd > 0) && ( !act->handled ) ) { char actsum[ 32 ]; + wchar_t ch = L'\0'; if ( act->char_present ) { - if ( isprint( act->ch ) ) { - snprintf( actsum, 32, "%s(0x%02x=%lc) ", - act->name().c_str(), act->ch, act->ch ); - } else { - snprintf( actsum, 32, "%s(0x%02x) ", - act->name().c_str(), act->ch ); - } - } else { - snprintf( actsum, 32, "[%s] ", - act->name().c_str() ); + ch = act->ch; } + snprintf( actsum, 32, "%s[%s](%s){%lc} ", + act->name().c_str(), + dispatch_chars.c_str(), + params.c_str(), + ch ); swrite( actfd, actsum ); }