From b1c80c912fb4a18a9435ee777246139ee27572d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Martin?= Date: Fri, 9 Oct 2026 23:14:20 +0200 Subject: [PATCH] SSH App: its messages were cleared the moment they were set The bottom-line message (a malformed address, not enough memory, a session still closing) is timed from millis() when a key sets it, and update() compared that with the pass's own time, read before the keys were handled. The unsigned difference wrapped, so the message was cleared before it was ever drawn: Enter on a new connection that was refused looked like it did nothing. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_0162FokPdvY2KsS4NBfwyWPk --- src/apps/ssh_app.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/apps/ssh_app.cpp b/src/apps/ssh_app.cpp index 349a767..01ed930 100644 --- a/src/apps/ssh_app.cpp +++ b/src/apps/ssh_app.cpp @@ -311,7 +311,9 @@ bool SshApp::onKey(const KeyEvent& e) { } void SshApp::update(uint32_t nowMs) { - if (!message_.empty() && nowMs - messageMs_ >= kMessageMs) { + // nowMs was read before this pass handled its keys: a message a key just set is "later" than it, + // and an unsigned difference would call that 49 days old, and clear it at once. + if (!message_.empty() && static_cast(nowMs - messageMs_) >= static_cast(kMessageMs)) { message_.clear(); requestRedraw(); }