From 476e623342a5ad2f2591bbe2b787c4b6f39e68d4 Mon Sep 17 00:00:00 2001 From: Dustin Kirkland Date: Sat, 24 Apr 2010 12:22:33 -0500 Subject: [PATCH] usr/bin/byobu: handle unset term in tput 256 color check --- debian/changelog | 1 + usr/bin/byobu | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index da381cb2..bd735889 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,7 @@ byobu (2.72) unreleased; urgency=low * usr/share/man/man1/byobu.1: document a sample custom script using custom colors, LP: #568967 * usr/bin/byobu: LANG=C before grepping for text + * usr/bin/byobu: handle unset term in tput 256 color check -- Dustin Kirkland Thu, 22 Apr 2010 12:31:20 -0500 diff --git a/usr/bin/byobu b/usr/bin/byobu index 93dc47bc..29100241 100755 --- a/usr/bin/byobu +++ b/usr/bin/byobu @@ -42,7 +42,7 @@ printf "\033]0;${USER}@$(hostname) - ${PKG}\007" grep -qs "^[^#]" "$HOME/.$PKG/windows" && DEFAULT_WINDOW= || DEFAULT_WINDOW="motd+shell" # Check if our terminfo supports 256 colors -[ -x /usr/bin/tput ] && [ $(/usr/bin/tput colors) -eq 256 ] && SCREEN_TERM="-T screen-256color" +[ -x /usr/bin/tput ] && [ $(/usr/bin/tput colors 2>/dev/null || echo 0) -eq 256 ] && SCREEN_TERM="-T screen-256color" # Create or update ssh-agent socket if [ -S "$SSH_AUTH_SOCK" ] && [ ! -h "$SSH_AUTH_SOCK" ] && [ -w "$RUN" ]; then