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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0162FokPdvY2KsS4NBfwyWPk
This commit is contained in:
2026-10-09 23:14:20 +02:00
co-authored by Claude Opus 5.5
parent 015a9c59bc
commit b1c80c912f
+3 -1
View File
@@ -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<int32_t>(nowMs - messageMs_) >= static_cast<int32_t>(kMessageMs)) {
message_.clear();
requestRedraw();
}