/bin/stty is in Debian&Alpine, /usr/bin/stty is in Cygwin.
--- a/.bashrc Tue Jan 01 23:38:59 2019 +0200
+++ b/.bashrc Wed Jan 02 23:49:07 2019 +0200
@@ -16,8 +16,12 @@
local ruler='================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================'
if [[ -x /usr/bin/tput ]]; then
local size=`/usr/bin/tput cols`
+ elif [[ -x /bin/stty ]]; then
+ local size=`/bin/stty size | { read x y; echo $y; }`
+ elif [[ -x /usr/bin/stty ]]; then
+ local size=`/usr/bin/stty size | { read x y; echo $y; }`
else
- local size=`/usr/bin/stty size | { read x y; echo $y; }`
+ local size=80
fi
ruler=${ruler:0:${size}}
_my_ruler=$ruler