From ab7ee4fd1e04668c31633b74a7651f0c4402a27f Mon Sep 17 00:00:00 2001 From: Jonas 'Sortie' Termansen Date: Mon, 30 Jul 2012 00:35:23 +0200 Subject: [PATCH] column(1) now queries the terminal width. --- utils/column.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/utils/column.cpp b/utils/column.cpp index 5f9ba72d..5db25a73 100644 --- a/utils/column.cpp +++ b/utils/column.cpp @@ -28,6 +28,7 @@ #include #include #include +#include int termwidth = 80; @@ -111,6 +112,10 @@ void version(const char* argv0) int main(int argc, char* argv[]) { + struct winsize ws; + if ( tcgetwinsize(1, &ws) == 0 ) + termwidth = ws.ws_col; + const char* argv0 = argv[0]; for ( int i = 1; i < argc; i++ )