chiark / gitweb /
systemctl: before spawning pager cache number of columns
[elogind.git] / src / systemctl.c
index 4f4ee961726ed7a6595bab372cc21f2294771e4d..2c8c2cf61d5165036beffe54ec8784a67dc0a2e1 100644 (file)
@@ -5316,6 +5316,10 @@ static void pager_open(void) {
                 if (!*pager || streq(pager, "cat"))
                         return;
 
+        /* Determine and cache number of columns before we spawn the
+         * pager so that we get the value from the actual tty */
+        columns();
+
         if (pipe(fd) < 0) {
                 log_error("Failed to create pager pipe: %m");
                 return;