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
|
fi
|
||||||
|
|
||||||
# shellcheck disable=SC2155
|
# shellcheck disable=SC2155
|
||||||
local width="$(stty size 2>/dev/null | cut -d' ' -f2)"
|
{ stty size 2>/dev/null || echo "22 80"; } | cut -d' ' -f2
|
||||||
if [[ -z "$width" ]]; then
|
return 0
|
||||||
echo "80"
|
|
||||||
else
|
|
||||||
echo "$width"
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user