mirror of
https://github.com/powerline/powerline.git
synced 2025-07-26 07:16:31 +02:00
Merge pull request #985 from ZyX-I/fix-983
Check whether $COLUMNS is empty or zero, not only empty
This commit is contained in:
commit
d66256ad34
@ -1,7 +1,7 @@
|
|||||||
function powerline-setup
|
function powerline-setup
|
||||||
function _powerline_columns_fallback
|
function _powerline_columns_fallback
|
||||||
if which stty ^/dev/null
|
if which stty >/dev/null
|
||||||
if stty size ^/dev/null
|
if stty size >/dev/null
|
||||||
stty size | cut -d' ' -f2
|
stty size | cut -d' ' -f2
|
||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
@ -11,7 +11,10 @@ function powerline-setup
|
|||||||
end
|
end
|
||||||
|
|
||||||
function _powerline_columns
|
function _powerline_columns
|
||||||
if test -z "$COLUMNS"
|
# Hack: `test "" -eq 0` is true, as well as `test 0 -eq 0`
|
||||||
|
# Note: at fish startup `$COLUMNS` is equal to zero, meaning that it may
|
||||||
|
# not be used.
|
||||||
|
if test "$COLUMNS" -eq 0
|
||||||
_powerline_columns_fallback
|
_powerline_columns_fallback
|
||||||
else
|
else
|
||||||
echo "$COLUMNS"
|
echo "$COLUMNS"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user