Implement bracketed paste mode

Allow bracketed paste mode-setting control sequences to be passed to the
outer terminal.

Signed-off-by: Barosl LEE <vcs@barosl.com>

Closes #430
This commit is contained in:
Barosl LEE
2013-05-29 12:54:29 +09:00
committed by Keith Winstein
parent 06561d3500
commit c6bf3a2025
4 changed files with 12 additions and 2 deletions
+6
View File
@@ -286,6 +286,12 @@ std::string Display::new_frame( bool initialized, const Framebuffer &last, const
frame.current_rendition = f.ds.get_renditions(); frame.current_rendition = f.ds.get_renditions();
} }
/* has bracketed paste mode changed? */
if ( (!initialized)
|| (f.ds.bracketed_paste != frame.last_frame.ds.bracketed_paste) ) {
frame.append( f.ds.bracketed_paste ? "\033[?2004h" : "\033[?2004l" );
}
return frame.str; return frame.str;
} }
+1 -1
View File
@@ -62,7 +62,7 @@ DrawState::DrawState( int s_width, int s_height )
renditions( 0 ), save(), renditions( 0 ), save(),
next_print_will_wrap( false ), origin_mode( false ), auto_wrap_mode( true ), next_print_will_wrap( false ), origin_mode( false ), auto_wrap_mode( true ),
insert_mode( false ), cursor_visible( true ), reverse_video( false ), insert_mode( false ), cursor_visible( true ), reverse_video( false ),
application_mode_cursor_keys( false ) bracketed_paste( false ), application_mode_cursor_keys( false )
{ {
reinitialize_tabs( 0 ); reinitialize_tabs( 0 );
} }
+3 -1
View File
@@ -189,6 +189,7 @@ namespace Terminal {
bool insert_mode; bool insert_mode;
bool cursor_visible; bool cursor_visible;
bool reverse_video; bool reverse_video;
bool bracketed_paste;
bool application_mode_cursor_keys; bool application_mode_cursor_keys;
@@ -237,7 +238,8 @@ namespace Terminal {
/* only compare fields that affect display */ /* only compare fields that affect display */
return ( width == x.width ) && ( height == x.height ) && ( cursor_col == x.cursor_col ) return ( width == x.width ) && ( height == x.height ) && ( cursor_col == x.cursor_col )
&& ( cursor_row == x.cursor_row ) && ( cursor_visible == x.cursor_visible ) && && ( cursor_row == x.cursor_row ) && ( cursor_visible == x.cursor_visible ) &&
( reverse_video == x.reverse_video ) && ( renditions == x.renditions ); ( reverse_video == x.reverse_video ) && ( renditions == x.renditions ) &&
( bracketed_paste == x.bracketed_paste );
} }
}; };
+2
View File
@@ -268,6 +268,8 @@ static bool *get_DEC_mode( int param, Framebuffer *fb ) {
return &(fb->ds.auto_wrap_mode); return &(fb->ds.auto_wrap_mode);
case 25: case 25:
return &(fb->ds.cursor_visible); return &(fb->ds.cursor_visible);
case 2004: /* bracketed paste */
return &(fb->ds.bracketed_paste);
} }
return NULL; return NULL;
} }