From 7353470c733658bd4645085180191f2bfd918ab5 Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Mon, 23 Sep 2019 20:03:14 +0200 Subject: [PATCH] width option fallback to tput Environment variable is not exported on some systems. --- barcat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/barcat b/barcat index 2acdadd..804b3b0 100755 --- a/barcat +++ b/barcat @@ -101,7 +101,7 @@ GetOptions(\%opt, }, ) or exit 64; # EX_USAGE -$opt{width} ||= $ENV{COLUMNS} || 80; +$opt{width} ||= $ENV{COLUMNS} || qx(tput cols) || 80; $opt{color} //= -t *STDOUT; # enable on tty $opt{'graph-format'} //= '-'; $opt{trim} *= $opt{width} / 100 if $opt{trimpct}; -- 2.30.0