From 463b75a6ac2d1bf481d22cc38d162f6aee9a87e0 Mon Sep 17 00:00:00 2001 From: Dustin Kirkland Date: Mon, 20 Feb 2012 13:26:58 -0600 Subject: [PATCH] - simply speed up using perl * usr/bin/byobu: LP: #937175 - check tput for 256 color support before defaulting to that in tmux mode --- debian/changelog | 4 +++- usr/bin/byobu | 8 ++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 018649b4..4b40e1a0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,7 +1,9 @@ byobu (5.13) unreleased; urgency=low * usr/lib/byobu/include/mondrian: - - simply and speed up using perl + - simply speed up using perl + * usr/bin/byobu: LP: #937175 + - check tput for 256 color support before defaulting to that in tmux mode -- Dustin Kirkland Thu, 16 Feb 2012 23:58:36 -0600 diff --git a/usr/bin/byobu b/usr/bin/byobu index e1d981e8..d9e1ac6d 100755 --- a/usr/bin/byobu +++ b/usr/bin/byobu @@ -93,8 +93,12 @@ fi case $BYOBU_BACKEND in tmux) - # Use 256 colors, unless the user has overridden - [ -z "$SCREEN_TERM" ] && SCREEN_TERM="-2" + # Use 256 colors if possible + if command -v tput >/dev/null; then + if [ "$(tput colors 2>/dev/null || echo 0)" = "256" ]; then + [ -z "$SCREEN_TERM" ] && SCREEN_TERM="-2" + fi + fi PROFILE="-f $BYOBU_PREFIX/share/$PKG/profiles/tmuxrc" sessions=$($BYOBU_BACKEND list-sessions 2>/dev/null) || true ;;