* usr/bin/byobu, usr/lib/byobu/.shutil:

- fix bold color printing
This commit is contained in:
Dustin Kirkland 2011-08-23 22:11:20 -05:00
commit c9c58547c3
3 changed files with 17 additions and 20 deletions

3
debian/changelog vendored
View file

@ -1,6 +1,7 @@
byobu (4.31) unreleased; urgency=low byobu (4.31) unreleased; urgency=low
* UNRELEASED * usr/bin/byobu, usr/lib/byobu/.shutil:
- fix bold color printing
-- Dustin Kirkland <kirkland@ubuntu.com> Sun, 21 Aug 2011 21:12:43 -0700 -- Dustin Kirkland <kirkland@ubuntu.com> Sun, 21 Aug 2011 21:12:43 -0700

View file

@ -61,7 +61,7 @@ case $BYOBU_BACKEND in
# Check if our terminfo supports 256 colors # Check if our terminfo supports 256 colors
if command -v tput >/dev/null; then if command -v tput >/dev/null; then
if [ "$(tput colors 2>/dev/null || echo 0)" = "256" ]; then if [ "$(tput colors 2>/dev/null || echo 0)" = "256" ]; then
export TERM="screen-256color" BYOBU_COLOR=256 export TERM="screen-256color"
fi fi
fi fi
PROFILE="-f $BYOBU_PREFIX/share/$PKG/profiles/tmuxrc" PROFILE="-f $BYOBU_PREFIX/share/$PKG/profiles/tmuxrc"
@ -85,7 +85,7 @@ case $BYOBU_BACKEND in
# Check if our terminfo supports 256 colors # Check if our terminfo supports 256 colors
if command -v tput >/dev/null; then if command -v tput >/dev/null; then
if [ "$(tput colors 2>/dev/null || echo 0)" = "256" ]; then if [ "$(tput colors 2>/dev/null || echo 0)" = "256" ]; then
export SCREEN_TERM="-T screen-256color" BYOBU_COLOR=256 export SCREEN_TERM="-T screen-256color"
fi fi
fi fi
# Some users want to maintain separate configurations # Some users want to maintain separate configurations

View file

@ -27,8 +27,8 @@ color_screen() {
-) printf "$ESC{-}" ;; -) printf "$ESC{-}" ;;
--) printf "$ESC{-} " ;; --) printf "$ESC{-} " ;;
esc) printf "$ESC" ;; esc) printf "$ESC" ;;
bold1) [ -n "$BYOBU_COLOR" ] && printf "$ESC{=b }" || printf "$ESC{= }" ;; bold1) printf "$ESC{=b }" || printf "$ESC{= }" ;;
bold2) [ -n "$BYOBU_COLOR" ] && printf "$ESC{+b }" || printf "$ESC{= }" ;; bold2) printf "$ESC{+b }" || printf "$ESC{= }" ;;
none) printf "$ESC{= }" ;; none) printf "$ESC{= }" ;;
invert) printf "$ESC{=r }" ;; invert) printf "$ESC{=r }" ;;
*) *)
@ -38,29 +38,26 @@ color_screen() {
attr= ; fg=$1 ; bg=$2 attr= ; fg=$1 ; bg=$2
;; ;;
3) 3)
attr= ; fg=$2 ; bg=$3 attr=$1 ; fg=$2 ; bg=$3
;; ;;
esac esac
[ "$MONOCHROME" = "1" ] && (fg= ; bg= ) [ "$MONOCHROME" = "1" ] && (fg= ; bg= )
[ -n "$BYOBU_COLOR" ] || attr=
printf "$ESC{=$attr $fg$bg}" printf "$ESC{=$attr $fg$bg}"
;; ;;
esac esac
} }
color_map() { color_map() {
local mod=
[ -n "$BYOBU_COLOR" ] && mod=",dim"
case "$1" in case "$1" in
k) _RET="black$mod" ;; k) _RET="black" ;;
r) _RET="red$mod" ;; r) _RET="red" ;;
g) _RET="green$mod" ;; g) _RET="green" ;;
y) _RET="yellow$mod" ;; y) _RET="yellow" ;;
b) _RET="blue$mod" ;; b) _RET="blue" ;;
m) _RET="magenta$mod" ;; m) _RET="magenta" ;;
c) _RET="cyan$mod" ;; c) _RET="cyan" ;;
w) _RET="white$mod" ;; w) _RET="white" ;;
d) _RET="color0$mod" ;; d) _RET="color0" ;;
K) _RET="#555555" ;; K) _RET="#555555" ;;
R) _RET="#FF0000" ;; R) _RET="#FF0000" ;;
G) _RET="#00FF00" ;; G) _RET="#00FF00" ;;
@ -85,7 +82,6 @@ attr_map() {
i) _RET=,italics ;; i) _RET=,italics ;;
*) _RET= ;; *) _RET= ;;
esac esac
[ -n "$BYOBU_COLOR" ] || _RET=
} }
color_tmux() { color_tmux() {
@ -95,7 +91,7 @@ color_tmux() {
-) printf "#[default]" ;; -) printf "#[default]" ;;
--) printf "#[default] " ;; --) printf "#[default] " ;;
esc) printf "" ;; esc) printf "" ;;
bold*) [ -n "$BYOBU_COLOR" ] && printf "#[fg=bold]" ;; bold*) printf "#[fg=bold]" ;;
none) printf "#[default]" ;; none) printf "#[default]" ;;
invert) printf "#[reverse]" ;; invert) printf "#[reverse]" ;;
*) *)