From aa5edea26d9cdbd80c2bc3aac8d1417ed6dae09f Mon Sep 17 00:00:00 2001 From: "jabber.developer2" Date: Wed, 27 May 2026 22:01:27 +0300 Subject: [PATCH] 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 and clears isendwin(). Guard it with isendwin(), matching the _inp_write() guard from the upstream "guard terminal writes while suspended" fix; this closes the one suspended-write path upstream left open. --- src/ui/inputwin.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/ui/inputwin.c b/src/ui/inputwin.c index 9ad741c6..1af74033 100644 --- a/src/ui/inputwin.c +++ b/src/ui/inputwin.c @@ -311,7 +311,10 @@ inp_get_line(void) werase(inp_win); wmove(inp_win, 0, 0); _inp_win_update_virtual(); - doupdate(); + // Don't write to the terminal while suspended (external editor active). + if (!isendwin()) { + doupdate(); + } char* line = NULL; while (!line) { line = inp_readline(); @@ -338,7 +341,10 @@ inp_get_password(void) werase(inp_win); wmove(inp_win, 0, 0); _inp_win_update_virtual(); - doupdate(); + // Don't write to the terminal while suspended (external editor active). + if (!isendwin()) { + doupdate(); + } char* password = NULL; get_password = TRUE; while (!password) {