From d1f2c277f8594ee7221d820cac5f90eec103feb3 Mon Sep 17 00:00:00 2001 From: Ian Hixson Date: Wed, 28 Dec 2022 14:52:06 -0800 Subject: Prevent flickering in curses Reading from curs_refresh(3X) from curses, calling doupdate() repeatedly will cause 'several bursts of output to the screen'. wnoutrefresh() has the smarts to only copy the changed lines to the copied virtual screen, but doupdate() does not. There have been several bug reports related to flickering but all seems to be inconsistenly reproducible due to different terminal buffering behavior. See #1032, #327 Unfortunately, when I am using a slow display, I still notice flickering, so this commit changes the routines for opening new windows and splitting windows to wait until the last change is finished before calling doupdate(). --- ui-terminal-curses.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ui-terminal-curses.c') diff --git a/ui-terminal-curses.c b/ui-terminal-curses.c index 93f729e..e9f726b 100644 --- a/ui-terminal-curses.c +++ b/ui-terminal-curses.c @@ -230,7 +230,8 @@ static void ui_curses_blit(UiTerm *tui) { } } wnoutrefresh(stdscr); - doupdate(); + if (tui->doupdate) + doupdate(); } static void ui_curses_clear(UiTerm *tui) { -- cgit v1.2.3