Compare commits

..

2 Commits

Author SHA1 Message Date
394df6d391 fix(ui): add authoritative suspend flag gating redraws over the editor
All checks were successful
CI Code / Check spelling (pull_request) Successful in 19s
CI Code / Check coding style (pull_request) Successful in 32s
CI Code / Code Coverage (pull_request) Successful in 2m37s
CI Code / Linux (debian) (pull_request) Successful in 4m41s
CI Code / Linux (ubuntu) (pull_request) Successful in 4m50s
CI Code / Linux (arch) (pull_request) Successful in 5m39s
Builds on the upstream "guard terminal writes while suspended" fix. That
fix keeps isendwin() a valid "suspended" signal by guarding stray writes
(_inp_write, beep, flash) so the existing isendwin() checks in
ui_update/ui_resize/ui_redraw hold. That is correct but fail-open: any
future unguarded doupdate()/refresh() reachable during an editor session
clears isendwin() and the ~10Hz ui_update() repaints over the editor
again (the original bug class).

Track suspension explicitly with a ui_suspended flag set in
ui_suspend()/ui_resume() and gate the three redraw entry points on
ui_suspended || isendwin() via _ui_redraw_suspended(). The flag is set
exactly at the suspend/resume boundary, so the dominant repaint path
fails safe regardless of isendwin() flapping. isendwin() is kept in the
condition for the shutdown/closed-screen case.
2026-05-27 22:16:51 +03:00
b282b12497 fix(ui): guard password/TLS prompt redraw while suspended
inp_get_line()/inp_get_password() issued an unconditional doupdate()
before their input loop. If such a prompt is raised while an external
editor is active (e.g. a reconnect password or TLS-cert prompt arriving
via session_process_events), that doupdate() writes over the editor.
Guard it with is_suspended || isendwin(), matching the inp_readline()
guard, so it fails safe even if a stray write later clears isendwin().
This closes the one suspended-write path the upstream fix left open.
2026-05-27 22:16:51 +03:00

View File

@@ -312,7 +312,7 @@ inp_get_line(void)
wmove(inp_win, 0, 0);
_inp_win_update_virtual();
// Don't write to the terminal while suspended (external editor active).
if (!isendwin()) {
if (!is_suspended && !isendwin()) {
doupdate();
}
char* line = NULL;
@@ -342,7 +342,7 @@ inp_get_password(void)
wmove(inp_win, 0, 0);
_inp_win_update_virtual();
// Don't write to the terminal while suspended (external editor active).
if (!isendwin()) {
if (!is_suspended && !isendwin()) {
doupdate();
}
char* password = NULL;