Skip to content

Instantly share code, notes, and snippets.

@saitoha
Last active August 29, 2015 14:20
Show Gist options
  • Select an option

  • Save saitoha/4b320b9cb6d637d14dbc to your computer and use it in GitHub Desktop.

Select an option

Save saitoha/4b320b9cb6d637d14dbc to your computer and use it in GitHub Desktop.
Distribution terms: This patch is in public domain.
diff -r bb75c6c7c8be mlterm/ml_vt100_parser.c
--- a/mlterm/ml_vt100_parser.c Sat Apr 18 07:12:56 2015 +0900
+++ b/mlterm/ml_vt100_parser.c Tue Apr 28 00:29:45 2015 +0900
@@ -3370,6 +3370,7 @@
vt100_parser->is_app_cursor_keys = 0 ;
vt100_parser->is_app_escape = 0 ;
vt100_parser->is_bracketed_paste_mode = 0 ;
+ vt100_parser->is_allow_deccolm = 0 ;
vt100_parser->im_is_active = 0 ;
}
@@ -4006,11 +4007,13 @@
else if( ps[count] == 3)
{
/* "CSI ? 3 h" */
-
- /* XTERM compatibility [#1048321] */
- clear_display_all( vt100_parser) ;
-
- resize( vt100_parser , 132 , 0 , 1) ;
+ if( vt100_parser->is_allow_deccolm)
+ {
+ /* XTERM compatibility [#1048321] */
+ clear_display_all( vt100_parser) ;
+
+ resize( vt100_parser , 132 , 0 , 1) ;
+ }
}
#if 0
else if( ps[count] == 4)
@@ -4069,12 +4072,11 @@
/* "CSI ? 35 h" shift keys */
}
#endif
- #if 0
else if( ps[count] == 40)
{
- /* "CSI ? 40 h" 80 <-> 132 */
+ /* Allow DECCOLM */
+ vt100_parser->is_allow_deccolm = 1 ;
}
- #endif
else if( ps[count] == 47)
{
/*
@@ -4296,11 +4298,13 @@
else if( ps[count] == 3)
{
/* "CSI ? 3 l" */
-
- /* XTERM compatibility [#1048321] */
- clear_display_all( vt100_parser) ;
-
- resize( vt100_parser , 80 , 0 , 1) ;
+ if( vt100_parser->is_allow_deccolm)
+ {
+ /* XTERM compatibility [#1048321] */
+ clear_display_all( vt100_parser) ;
+
+ resize( vt100_parser , 80 , 0 , 1) ;
+ }
}
#if 0
else if( ps[count] == 4)
@@ -4360,12 +4364,11 @@
/* "CSI ? 35 l" shift keys */
}
#endif
- #if 0
else if( ps[count] == 40)
{
- /* "CSI ? 40 l" 80 <-> 132 */
+ /* Disallow DECCOLM */
+ vt100_parser->is_allow_deccolm = 0 ;
}
- #endif
else if( ps[count] == 47)
{
/* "CSI ? 47 l" Use normal screen buffer */
diff -r bb75c6c7c8be mlterm/ml_vt100_parser.h
--- a/mlterm/ml_vt100_parser.h Sat Apr 18 07:12:56 2015 +0900
+++ b/mlterm/ml_vt100_parser.h Tue Apr 28 00:29:45 2015 +0900
@@ -257,6 +257,7 @@
int8_t is_app_cursor_keys ;
int8_t is_app_escape ;
int8_t is_bracketed_paste_mode ;
+ int8_t is_allow_deccolm ;
int8_t want_focus_event ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment