Support "reset"

This commit is contained in:
Keith Winstein
2011-02-01 02:29:54 -05:00
parent 39dfccf450
commit 73af007db4
3 changed files with 17 additions and 0 deletions
+7
View File
@@ -306,3 +306,10 @@ void Framebuffer::delete_cell( int row, int col )
{
rows[ row ].delete_cell( col );
}
void Framebuffer::reset( void )
{
int width = ds.get_width(), height = ds.get_height();
rows = std::deque<Row>( height, Row( width ) );
ds = DrawState( width, height );
}
+2
View File
@@ -127,6 +127,8 @@ namespace Terminal {
void insert_cell( int row, int col );
void delete_cell( int row, int col );
void reset( void );
};
}
+8
View File
@@ -439,3 +439,11 @@ void CSI_ECH( Framebuffer *fb, Dispatcher *dispatch )
}
static Function func_CSI_ECH( CSI, "X", CSI_ECH );
/* reset to initial state */
void Esc_RIS( Framebuffer *fb, Dispatcher *dispatch __attribute((unused)) )
{
fb->reset();
}
static Function func_Esc_RIS( ESCAPE, "c", Esc_RIS );