chiark / gitweb /
util: look at STDOUT, not STDIN, when determining tty columns
[elogind.git] / src / util.c
index a09b704ffebd1e2195a17b6b4a95fdab717afdb2..f982586cee9b1d2c1939e8b7f8d4ecd13a3e5e81 100644 (file)
@@ -2988,7 +2988,7 @@ int columns(void) {
                 struct winsize ws;
                 zero(ws);
 
-                if (ioctl(STDIN_FILENO, TIOCGWINSZ, &ws) >= 0)
+                if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &ws) >= 0)
                         parsed_columns = ws.ws_col;
         }