terminal_size should use LINES, not ROWS.
authorElliott Hughes <enh@google.com>
Fri, 17 Apr 2015 02:21:02 +0000 (21:21 -0500)
committerRob Landley <rob@landley.net>
Fri, 17 Apr 2015 02:21:02 +0000 (21:21 -0500)
The shell's pseudo-variable is called LINES. This is true of at least
bash and mksh.

lib/lib.c

index 9664bec..99d2ea6 100644 (file)
--- a/lib/lib.c
+++ b/lib/lib.c
@@ -627,7 +627,7 @@ int terminal_size(unsigned *xx, unsigned *yy)
   }
   s = getenv("COLUMNS");
   if (s) sscanf(s, "%u", &x);
-  s = getenv("ROWS");
+  s = getenv("LINES");
   if (s) sscanf(s, "%u", &y);
 
   // Never return 0 for either value, leave it at default instead.