Skip to content

Commit

Permalink
Fix: Delayed reporting of "TERMINAL TOO SMALL".
Browse files Browse the repository at this point in the history
It seems that performing a temporary suspend (via endwin() /
refresh()) is the accepted way to force Curses to refresh its
terminal context, and it isn't until after that that the new COLS
and LINES settings take effect.  It feels uncomfortable to have
that update happen as a side-effect of an otherwise redundant
suspend sequence, however, it appears to be the only portable way
of doing it.

Multiple refresh()s may introduce some visible screen flicker (which
the code elsewhere in MOC tries to avoid), but it has not been
observed in testing and is probably masked by the resizing operation.

Thanks to: Joan Bruguera Mico <[email protected]>
Resolves: node/2177 (MOC prints "TERMINAL TOO SMALL" when it's not)

git-svn-id: svn://svn.daper.net/moc/trunk@2994 910807d9-36e0-0310-a014-e9ea483e2ba4
  • Loading branch information
jcf committed Jan 9, 2019
1 parent 3cada6e commit a35dfa2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions interface_elements.c
Original file line number Diff line number Diff line change
Expand Up @@ -4132,10 +4132,10 @@ void iface_error (const char *msg)
/* Handle screen resizing. */
void iface_resize ()
{
check_term_size (&main_win, &info_win);
validate_layouts ();
endwin ();
refresh ();
check_term_size (&main_win, &info_win);
validate_layouts ();
main_win_resize (&main_win);
info_win_resize (&info_win);
iface_refresh_screen ();
Expand Down

0 comments on commit a35dfa2

Please sign in to comment.