From 810e212b4b255914cfa73e85b52ec23db281c0e3 Mon Sep 17 00:00:00 2001 From: salmonik Date: Thu, 29 Oct 2026 23:06:22 +0100 Subject: v3.1.0: warn on shrink, but let a live round finish --- src/client/ui.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/client/ui.rs') diff --git a/src/client/ui.rs b/src/client/ui.rs index 6161166..ca001c2 100644 --- a/src/client/ui.rs +++ b/src/client/ui.rs @@ -261,6 +261,16 @@ pub fn terminal_too_small(columns: u16, rows: u16) -> Option { )) } +/// One-line warning for a terminal that shrank while the client is running. +pub fn terminal_size_warning(columns: u16, rows: u16) -> Option { + if columns >= MIN_COLUMNS && rows >= MIN_ROWS { + return None; + } + Some(format!( + "WARNING: terminal is {columns}x{rows}; zagan.bet needs at least {MIN_COLUMNS}x{MIN_ROWS}. Resize to fit." + )) +} + /// Render remembered hosts. /// /// Two addresses that present the same certificate key are the same server, so -- cgit v1.2.3