Cursor visibility

This commit is contained in:
Keith Winstein
2011-02-01 02:53:39 -05:00
parent 6265f192ad
commit 2f1ccdf6eb
4 changed files with 10 additions and 3 deletions
+6 -2
View File
@@ -180,8 +180,12 @@ void Emulator::debug_printout( int fd )
} }
char curmove[ 32 ]; char curmove[ 32 ];
snprintf( curmove, 32, "\033[%d;%dH", fb.ds.get_cursor_row() + 1, if ( fb.ds.cursor_visible ) {
fb.ds.get_cursor_col() + 1 ); snprintf( curmove, 32, "\033[?25h\033[%d;%dH", fb.ds.get_cursor_row() + 1,
fb.ds.get_cursor_col() + 1 );
} else {
snprintf( curmove, 32, "\033[?25l" );
}
screen.append( curmove ); screen.append( curmove );
swrite( fd, screen.c_str() ); swrite( fd, screen.c_str() );
+1 -1
View File
@@ -47,7 +47,7 @@ DrawState::DrawState( int s_width, int s_height )
scrolling_region_top_row( 0 ), scrolling_region_bottom_row( height - 1 ), scrolling_region_top_row( 0 ), scrolling_region_bottom_row( height - 1 ),
renditions(), save(), renditions(), 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 ) insert_mode( false ), cursor_visible( true )
{ {
for ( int i = 0; i < width; i++ ) { for ( int i = 0; i < width; i++ ) {
tabs[ i ] = ( (i % 8) == 0 ); tabs[ i ] = ( (i % 8) == 0 );
+1
View File
@@ -67,6 +67,7 @@ namespace Terminal {
bool origin_mode; bool origin_mode;
bool auto_wrap_mode; bool auto_wrap_mode;
bool insert_mode; bool insert_mode;
bool cursor_visible;
/* bold, etc. */ /* bold, etc. */
+2
View File
@@ -220,6 +220,8 @@ static bool *get_DEC_mode( int param, Framebuffer *fb ) {
return &(fb->ds.origin_mode); return &(fb->ds.origin_mode);
case 7: /* auto wrap */ case 7: /* auto wrap */
return &(fb->ds.auto_wrap_mode); return &(fb->ds.auto_wrap_mode);
case 25:
return &(fb->ds.cursor_visible);
} }
return NULL; return NULL;
} }