mirror of
https://github.com/eth-p/bat-extras.git
synced 2024-10-05 01:11:57 +02:00
lib: Reduce size of term_width function
This commit is contained in:
parent
427baf1491
commit
c98e21df04
@ -18,10 +18,6 @@ term_width() {
|
||||
fi
|
||||
|
||||
# shellcheck disable=SC2155
|
||||
local width="$(stty size 2>/dev/null | cut -d' ' -f2)"
|
||||
if [[ -z "$width" ]]; then
|
||||
echo "80"
|
||||
else
|
||||
echo "$width"
|
||||
fi
|
||||
{ stty size 2>/dev/null || echo "22 80"; } | cut -d' ' -f2
|
||||
return 0
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user