Handle 7-bit ESC-encoding of C1 control characters

This commit is contained in:
Keith Winstein
2011-01-31 05:18:57 -05:00
parent a49378b23b
commit 30f03a52f6
2 changed files with 12 additions and 1 deletions
+9
View File
@@ -108,8 +108,17 @@ void Emulator::CSI_dispatch( Parser::CSI_Dispatch *act )
void Emulator::Esc_dispatch( Parser::Esc_Dispatch *act ) void Emulator::Esc_dispatch( Parser::Esc_Dispatch *act )
{ {
/* handle 7-bit ESC-encoding of C1 control characters */
if ( (dispatch.get_dispatch_chars().size() == 0)
&& (0x40 <= act->ch)
&& (act->ch <= 0x5F) ) {
act->ch += 0x40;
dispatch.dispatch( CONTROL, act, &fb );
act->ch -= 0x40;
} else {
dispatch.dispatch( ESCAPE, act, &fb ); dispatch.dispatch( ESCAPE, act, &fb );
} }
}
void Emulator::debug_printout( int fd ) void Emulator::debug_printout( int fd )
{ {
+2
View File
@@ -111,6 +111,7 @@ void Ctrl_LF( Framebuffer *fb, Dispatcher *dispatch __attribute((unused)) )
} }
static Function func_Ctrl_LF( CONTROL, "\x0a", Ctrl_LF ); static Function func_Ctrl_LF( CONTROL, "\x0a", Ctrl_LF );
static Function func_Ctrl_IND( CONTROL, "\x84", Ctrl_LF );
void Ctrl_CR( Framebuffer *fb, Dispatcher *dispatch __attribute((unused)) ) void Ctrl_CR( Framebuffer *fb, Dispatcher *dispatch __attribute((unused)) )
{ {
@@ -125,3 +126,4 @@ void Ctrl_BS( Framebuffer *fb, Dispatcher *dispatch __attribute((unused)) )
} }
static Function func_Ctrl_BS( CONTROL, "\x08", Ctrl_BS ); static Function func_Ctrl_BS( CONTROL, "\x08", Ctrl_BS );