chiark / gitweb /
util: look at STDOUT, not STDIN, when determining tty columns
[elogind.git] / src / util.c
index a09b704..f982586 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;
         }