chiark / gitweb /
pager: cache not only number of columns but also of lines before we open pager
authorLennart Poettering <lennart@poettering.net>
Fri, 10 Nov 2017 20:10:17 +0000 (21:10 +0100)
committerSven Eden <yamakuzure@gmx.net>
Fri, 10 Nov 2017 20:10:17 +0000 (21:10 +0100)
Not that we need it, but let's do this as matter of completeness.

src/shared/pager.c

index ce0f37066c26febc8a3a41f4560963e2080ddf69..a364fa7e1cb6f4ba74d5c8e30f676d0ca785d78f 100644 (file)
@@ -80,9 +80,10 @@ int pager_open(bool no_pager, bool jump_to_end) {
         if (pager && STR_IN_SET(pager, "", "cat"))
                 return 0;
 
-        /* Determine and cache number of columns before we spawn the
-         * pager so that we get the value from the actual tty */
+        /* Determine and cache number of columns/lines before we spawn the pager so that we get the value from the
+         * actual tty */
         (void) columns();
+        (void) lines();
 
         if (pipe2(fd, O_CLOEXEC) < 0)
                 return log_error_errno(errno, "Failed to create pager pipe: %m");