usr/share/byobu/profiles/common, usr/bin/byobu:

This commit is contained in:
Dustin Kirkland 2011-08-20 11:28:56 -07:00
commit 1701c06fcb
3 changed files with 15 additions and 9 deletions

2
debian/changelog vendored
View file

@ -77,7 +77,7 @@ byobu (4.30) unreleased; urgency=low
* usr/bin/byobu, usr/bin/byobu-janitor, usr/lib/byobu/.shutil: * usr/bin/byobu, usr/bin/byobu-janitor, usr/lib/byobu/.shutil:
- flatten bold/dim/bright modifiers when in 8-color mode - flatten bold/dim/bright modifiers when in 8-color mode
* usr/lib/byobu/ip_address, usr/lib/byobu/.shutil, * usr/lib/byobu/ip_address, usr/lib/byobu/.shutil,
usr/share/byobu/profiles/common: usr/share/byobu/profiles/common, usr/bin/byobu:
- fix bold printing - fix bold printing
-- Dustin Kirkland <kirkland@ubuntu.com> Thu, 11 Aug 2011 10:31:31 -0500 -- Dustin Kirkland <kirkland@ubuntu.com> Thu, 11 Aug 2011 10:31:31 -0500

View file

@ -42,7 +42,7 @@ fi
# Determine backend # Determine backend
case "$0" in case "$0" in
*byobu-screen) export BYOBU_BACKEND="screen" ;; *byobu-screen) export BYOBU_BACKEND="screen" ;;
*byobu-tmux) export BYOBU_BACKEND="tmux" TERM="screen-256color" ;; *byobu-tmux) export BYOBU_BACKEND="tmux" ;;
esac esac
# Sanitize the environment # Sanitize the environment
@ -58,6 +58,12 @@ fi
case $BYOBU_BACKEND in case $BYOBU_BACKEND in
tmux) tmux)
# Check if our terminfo supports 256 colors
if command -v tput >/dev/null; then
if [ "$(tput colors 2>/dev/null || echo 0)" = "256" ]; then
export TERM="screen-256color" BYOBU_COLOR=256
fi
fi
PROFILE="-f $BYOBU_PREFIX/share/$PKG/profiles/tmuxrc" PROFILE="-f $BYOBU_PREFIX/share/$PKG/profiles/tmuxrc"
;; ;;
*) *)
@ -79,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" export SCREEN_TERM="-T screen-256color" BYOBU_COLOR=256
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 "$SCREEN_TERM" ] && printf "$ESC{=b }" || printf "$ESC{= }" ;; bold1) [ -n "$BYOBU_COLOR" ] && printf "$ESC{=b }" || printf "$ESC{= }" ;;
bold2) [ -n "$SCREEN_TERM" ] && printf "$ESC{+b }" || printf "$ESC{= }" ;; bold2) [ -n "$BYOBU_COLOR" ] && printf "$ESC{+b }" || printf "$ESC{= }" ;;
none) printf "$ESC{= }" ;; none) printf "$ESC{= }" ;;
invert) printf "$ESC{=r }" ;; invert) printf "$ESC{=r }" ;;
*) *)
@ -42,7 +42,7 @@ color_screen() {
;; ;;
esac esac
[ "$MONOCHROME" = "1" ] && (fg= ; bg= ) [ "$MONOCHROME" = "1" ] && (fg= ; bg= )
[ -n "$SCREEN_TERM" ] || attr= [ -n "$BYOBU_COLOR" ] || attr=
printf "$ESC{=$attr $fg$bg}" printf "$ESC{=$attr $fg$bg}"
;; ;;
esac esac
@ -50,7 +50,7 @@ color_screen() {
color_map() { color_map() {
local mod= local mod=
[ -n "$SCREEN_TERM" ] && mod=",dim" [ -n "$BYOBU_COLOR" ] && mod=",dim"
case "$1" in case "$1" in
k) _RET="black$mod" ;; k) _RET="black$mod" ;;
r) _RET="red$mod" ;; r) _RET="red$mod" ;;
@ -85,7 +85,7 @@ attr_map() {
i) _RET=,italics ;; i) _RET=,italics ;;
*) _RET= ;; *) _RET= ;;
esac esac
[ -n "$SCREEN_TERM" ] || _RET= [ -n "$BYOBU_COLOR" ] || _RET=
} }
color_tmux() { color_tmux() {
@ -95,7 +95,7 @@ color_tmux() {
-) printf "#[default]" ;; -) printf "#[default]" ;;
--) printf "#[default] " ;; --) printf "#[default] " ;;
esc) printf "" ;; esc) printf "" ;;
bold*) [ -n "$SCREEN_TERM" ] && printf "#[fg=bold]" ;; bold*) [ -n "$BYOBU_COLOR" ] && printf "#[fg=bold]" ;;
none) printf "#[default]" ;; none) printf "#[default]" ;;
invert) printf "#[reverse]" ;; invert) printf "#[reverse]" ;;
*) *)