Improve window refresh

It's not perfect, sometimes the input buffer isn't printed properly
This commit is contained in:
Aaron Cook 2022-07-02 18:04:22 -05:00
commit bcec4fed68
3 changed files with 99 additions and 92 deletions

View file

@ -258,6 +258,8 @@ bytenuts_set_status(int user, const char *fmt, ...)
int
bytenuts_update_screen_size()
{
char *old_status = strdup(bytenuts.bytenuts_status);
pthread_mutex_lock(&bytenuts.term_lock);
wresize(bytenuts.status_win, 1, COLS);
@ -274,7 +276,10 @@ bytenuts_update_screen_size()
pthread_mutex_unlock(&bytenuts.term_lock);
ingest_refresh();
bytenuts_set_status(STATUS_BYTENUTS, old_status);
cheerios_insert("", 0);
free(old_status);
return 0;
}