Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Implement vt100 mouse mode (1000)

(closes #461)
  • Loading branch information...
commit 492cfa3449d8a7b29d08d71a58bd00aedb17d711 1 parent bb36933
@niieani niieani authored committed
View
8 src/terminal/terminaldisplay.cc
@@ -292,7 +292,13 @@ std::string Display::new_frame( bool initialized, const Framebuffer &last, const
frame.append( f.ds.bracketed_paste ? "\033[?2004h" : "\033[?2004l" );
}
- /* has xterm mouse mode changed (SET_ANY_EVENT_MOUSE)? */
+ /* has xterm VT100 mouse mode changed? */
+ if ( (!initialized)
+ || (f.ds.vt100_mouse != frame.last_frame.ds.vt100_mouse) ) {
+ frame.append( f.ds.vt100_mouse ? "\033[?1000h" : "\033[?1000l" );
+ }
+
+ /* has xterm mouse mode changed? */
if ( (!initialized)
|| (f.ds.xterm_mouse != frame.last_frame.ds.xterm_mouse) ) {
frame.append( f.ds.xterm_mouse ? "\033[?1002h" : "\033[?1002l" );
View
4 src/terminal/terminalframebuffer.cc
@@ -62,8 +62,8 @@ DrawState::DrawState( int s_width, int s_height )
renditions( 0 ), save(),
next_print_will_wrap( false ), origin_mode( false ), auto_wrap_mode( true ),
insert_mode( false ), cursor_visible( true ), reverse_video( false ),
- bracketed_paste( false ), xterm_mouse( false ), xterm_extended_mouse( false ),
- application_mode_cursor_keys( false )
+ bracketed_paste( false ), vt100_mouse( false ), xterm_mouse( false ),
+ xterm_extended_mouse( false ), application_mode_cursor_keys( false )
{
reinitialize_tabs( 0 );
}
View
5 src/terminal/terminalframebuffer.h
@@ -190,6 +190,7 @@ namespace Terminal {
bool cursor_visible;
bool reverse_video;
bool bracketed_paste;
+ bool vt100_mouse;
bool xterm_mouse;
bool xterm_extended_mouse;
@@ -241,8 +242,8 @@ namespace Terminal {
return ( width == x.width ) && ( height == x.height ) && ( cursor_col == x.cursor_col )
&& ( cursor_row == x.cursor_row ) && ( cursor_visible == x.cursor_visible ) &&
( reverse_video == x.reverse_video ) && ( renditions == x.renditions ) &&
- ( bracketed_paste == x.bracketed_paste ) && ( xterm_mouse == x.xterm_mouse ) &&
- ( xterm_extended_mouse == x.xterm_extended_mouse );
+ ( bracketed_paste == x.bracketed_paste ) && ( vt100_mouse == x.vt100_mouse ) &&
+ ( xterm_mouse == x.xterm_mouse ) && ( xterm_extended_mouse == x.xterm_extended_mouse );
}
};
View
1  src/terminal/terminalfunctions.cc
@@ -269,6 +269,7 @@ static bool *get_DEC_mode( int param, Framebuffer *fb ) {
case 25:
return &(fb->ds.cursor_visible);
case 1000: /* xterm mouse 1 (normal) */
+ return &(fb->ds.vt100_mouse);
case 1002: /* xterm mouse 2 (inc. button drags) */
return &(fb->ds.xterm_mouse);
case 1006: /* xterm extended mouse */
Please sign in to comment.
Something went wrong with that request. Please try again.