Detect and handle terminals size changes

darcs-hash:20061004214502-ac50b-aaf5b76a6281c0ba8757e794b0a802793ce92916.gz
This commit is contained in:
axel
2006-10-05 07:45:02 +10:00
parent 0ea668b260
commit d1078f8582
5 changed files with 24 additions and 13 deletions

View File

@@ -490,10 +490,18 @@ static void s_update( screen_t *scr, wchar_t *prompt )
int i, j, k;
int prompt_width = calc_prompt_width( prompt );
int current_width=0;
int screen_width = common_get_width();
buffer_t output;
b_init( &output );
if( scr->actual_width != screen_width )
{
s_move( scr, &output, 0, 0 );
scr->actual_width = screen_width;
s_reset( scr );
}
if( wcscmp( prompt, (wchar_t *)scr->actual_prompt.buff ) )
{
s_move( scr, &output, 0, 0 );