From 56976a127c081a6a008c81966360003a8711a319 Mon Sep 17 00:00:00 2001 From: Stefano Zacchiroli Date: Mon, 13 Oct 2014 23:15:23 +0200 Subject: make --columns default to terminal width, as returned by ioctl() If set, the COLUMNS environment variable will take precedence over terminal width. However, please note that COLUMNS is usually *not* exported by shells to child processes, so in most cases COLUMNS will be undefined for ledger---hence the motivation for this change. Terminal width is queried using ioctl() on stdin. For the sake of portability the querying is done only on platform where ioctl() is detected as supported at compile-time. --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 6592f106..09d14051 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -87,6 +87,7 @@ check_function_exists(access HAVE_ACCESS) check_function_exists(realpath HAVE_REALPATH) check_function_exists(getpwuid HAVE_GETPWUID) check_function_exists(getpwnam HAVE_GETPWNAM) +check_function_exists(ioctl HAVE_IOCTL) check_function_exists(isatty HAVE_ISATTY) check_c_source_compiles(" -- cgit v1.2.3