git.shiar.nl
/
barcat.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
86ddf3f
)
width option fallback to tput
author
Mischa POSLAWSKY
<perl@shiar.org>
Mon, 23 Sep 2019 18:03:14 +0000
(20:03 +0200)
committer
Mischa POSLAWSKY
<perl@shiar.org>
Tue, 24 Sep 2019 00:08:51 +0000
(
02:08
+0200)
Environment variable is not exported on some systems.
barcat
patch
|
blob
|
history
diff --git
a/barcat
b/barcat
index 2acdaddfca5c4cf232a67cb35375742fcfaddea4..804b3b074b8c54ba005c61ffdd1ffb32c73b01a4 100755
(executable)
--- 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};