Support "reset"
This commit is contained in:
@@ -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 );
|
||||
}
|
||||
|
||||
@@ -127,6 +127,8 @@ namespace Terminal {
|
||||
|
||||
void insert_cell( int row, int col );
|
||||
void delete_cell( int row, int col );
|
||||
|
||||
void reset( void );
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user