--- ncurses-6.4+20240113/ncurses/base/lib_getch.c.orig
+++ ncurses-6.4+20240113/ncurses/base/lib_getch.c
@@ -375,6 +375,22 @@
 
 static int kgetch(SCREEN *, bool EVENTLIST_2nd(_nc_eventlist *));
 
+/*
+ * This flag provides control over whether or not a refresh is invoked during
+ * getch() processing.  If TRUE, a refresh is possible (it will only be done
+ * if there is a change pending AND the window is not a pad). If FALSE, then
+ * no refresh will occur, even if there are changes pending.
+ */
+static int getch_refresh = TRUE;
+
+NCURSES_EXPORT(void)
+auto_getch_refresh (bool refresh)
+{
+    T((T_CALLED("auto_getch_refresh(%d)"), refresh));
+    getch_refresh = refresh;
+    returnVoid;
+}
+
 static void
 recur_wrefresh(WINDOW *win)
 {
@@ -402,7 +418,8 @@
 	_nc_unlock_global(curses);
     } else
 #endif
-	if ((is_wintouched(win) || (win->_flags & _HASMOVED))
+	if (getch_refresh
+	    && (is_wintouched(win) || (win->_flags & _HASMOVED))
 	    && !IS_PAD(win)) {
 	wrefresh(win);
     }

