From 4144f2e4f01a91f088c86a0d83f762c8130c27b3 Mon Sep 17 00:00:00 2001 From: Keith Winstein Date: Wed, 11 Apr 2012 01:58:20 -0400 Subject: [PATCH] Don't clear wrap state on DEC set mode escape (matches xterm) --- src/terminal/terminalframebuffer.cc | 4 ++-- src/terminal/terminalfunctions.cc | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/terminal/terminalframebuffer.cc b/src/terminal/terminalframebuffer.cc index efb574d..c38603d 100644 --- a/src/terminal/terminalframebuffer.cc +++ b/src/terminal/terminalframebuffer.cc @@ -112,8 +112,8 @@ void DrawState::move_col( int N, bool relative, bool implicit ) cursor_col = N; } - if ( implicit && (cursor_col >= width) ) { - next_print_will_wrap = true; + if ( implicit ) { + next_print_will_wrap = (cursor_col >= width); } snap_cursor_to_border(); diff --git a/src/terminal/terminalfunctions.cc b/src/terminal/terminalfunctions.cc index 90b8c0f..2dd69f7 100644 --- a/src/terminal/terminalfunctions.cc +++ b/src/terminal/terminalfunctions.cc @@ -273,8 +273,9 @@ void CSI_DECRM( Framebuffer *fb, Dispatcher *dispatch ) } } -static Function func_CSI_DECSM( CSI, "?h", CSI_DECSM ); -static Function func_CSI_DECRM( CSI, "?l", CSI_DECRM ); +/* These functions don't clear wrap state. */ +static Function func_CSI_DECSM( CSI, "?h", CSI_DECSM, false ); +static Function func_CSI_DECRM( CSI, "?l", CSI_DECRM, false ); static bool *get_ANSI_mode( int param, Framebuffer *fb ) { switch ( param ) {