byobu-status: allow for no color decorations, helps with older versions

of screen, LP: #432165
This commit is contained in:
Dustin Kirkland 2009-12-13 19:06:07 -08:00
commit 585d1559cd
2 changed files with 7 additions and 3 deletions

View file

@ -33,8 +33,10 @@ find_script () {
# Define colors # Define colors
ESC="\005" ESC="\005"
color() { color() {
if [ -z "$1" ] || [ "$COLOR" = "none" ]; then
return 0
fi
case $1 in case $1 in
"") true ;;
-) printf "$ESC{-}" ;; -) printf "$ESC{-}" ;;
esc) printf "$ESC" ;; esc) printf "$ESC" ;;
bold1) printf "$ESC{=b }" ;; bold1) printf "$ESC{=b }" ;;
@ -43,9 +45,9 @@ color() {
invert) printf "$ESC{=r }" ;; invert) printf "$ESC{=r }" ;;
*) *)
if [ "$#" = "2" ]; then if [ "$#" = "2" ]; then
[ "$MONOCHROME" = "1" ] && printf "$ESC{= }" || printf "$ESC{= $1$2}" [ "$COLOR" = "monochrome" ] && printf "$ESC{= }" || printf "$ESC{= $1$2}"
else else
[ "$MONOCHROME" = "1" ] && printf "$ESC{=$1 }" || printf "$ESC{=$1 $2$3}" [ "$COLOR" = "monochrome" ] && printf "$ESC{=$1 }" || printf "$ESC{=$1 $2$3}"
fi fi
;; ;;
esac esac

2
debian/changelog vendored
View file

@ -73,6 +73,8 @@ byobu (2.40) unreleased; urgency=low
- define and use a color function for all status indicators, gives - define and use a color function for all status indicators, gives
infinite flexibility infinite flexibility
- replace "undo" with "-" - replace "undo" with "-"
* byobu-status: allow for no color decorations, helps with older versions
of screen, LP: #432165
-- Dustin Kirkland <kirkland@ubuntu.com> Tue, 10 Nov 2009 10:18:20 -0600 -- Dustin Kirkland <kirkland@ubuntu.com> Tue, 10 Nov 2009 10:18:20 -0600