I noticed that quad-pw wasn't changing with window resizes on macOS (Sonoma
14.7.2).
Here's a patch; there's probably a better way to do it.
I don't think it will break Linux builds, and it might help other OS (the
BSDs maybe?), since not everyone has the same magic number for TIOCGWINSZ..

$ diff -u src/main-orig.cc src/main.cc
--- src/main-orig.cc 2024-12-19 13:20:04.000000000 -0600
+++ src/main.cc 2024-12-20 13:53:29.000000000 -0600
@@ -131,7 +131,10 @@
    // TIOCGWINSZ is 0x5413 on GNU/Linux. We use 0x5413 instead of
TIOCGWINSZ
    // because TIOCGWINSZ may not exist on all platforms
    //
-   if (0 != ioctl(STDIN_FILENO, 0x5413, &wsize))   return;
+#ifndef TIOCGWINSZ
+#define TIOCGWINSZ 0x5413
+#endif
+   if (0 != ioctl(STDIN_FILENO, TIOCGWINSZ, &wsize))   return;
    if (wsize.ws_col < MIN_Quad_PW)   return;
    if (wsize.ws_col > MAX_Quad_PW)   return;

-- 
Mike Hall

Reply via email to