From 3fcb2896cb28b8c48d592aff22d854b6f28588b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=99emysl=20Eric=20Janouch?= Date: Sat, 12 Sep 2020 12:37:08 +0200 Subject: [PATCH] Make it possible to abort column check --- termtest.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/termtest.c b/termtest.c index e7335c1..93a91c5 100644 --- a/termtest.c +++ b/termtest.c @@ -281,9 +281,11 @@ int main(int argc, char *argv[]) { comm(CSI "4c" DCS "0;0;0;q??~~??~~??iTiTiT" ST, false); printf("-- Mouse protocol\n"); - while (!ioctl(STDIN_FILENO, TIOCGWINSZ, &ws) && ws.ws_col < 223) - comm("Your terminal needs to be at least 223 columns wide.\n" - "Press a key once you've made it wide enough.\n", true); + while (!ioctl(STDIN_FILENO, TIOCGWINSZ, &ws) && ws.ws_col < 223) { + if (!*comm("Your terminal needs to be at least 223 columns wide.\n" + "Press a key once you've made it wide enough.\n", true)) + break; + } printf("Click the rightmost column, if it's possible.\n"); int mouses[] = { 1005, 1006, 1015, 1016 };