From cf843850798f15cbeb375684b34534d14dcab1e9 Mon Sep 17 00:00:00 2001 From: Dustin Kirkland Date: Fri, 8 Nov 2013 12:27:25 -0600 Subject: [PATCH] * usr/lib/byobu/include/common: - simplify backend detection --- debian/changelog | 2 ++ usr/lib/byobu/include/common | 11 +++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index 08529644..ed191e9a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,6 +7,8 @@ byobu (5.64) unreleased; urgency=low * etc/byobu/backend, usr/lib/byobu/include/common: - really default to tmux, at this point - tmux was the default in the previous LTS + * usr/lib/byobu/include/common: + - simplify backend detection -- Dustin Kirkland Thu, 07 Nov 2013 11:55:15 -0600 diff --git a/usr/lib/byobu/include/common b/usr/lib/byobu/include/common index 0cf325d4..391423cc 100755 --- a/usr/lib/byobu/include/common +++ b/usr/lib/byobu/include/common @@ -34,12 +34,11 @@ if [ -z "${BYOBU_INCLUDED_LIBS}" ]; then # Just in case there's no config file at all if [ -z "${BYOBU_BACKEND}" ]; then # New byobu configuration, default to tmux - for i in tmux screen; do - $BYOBU_TEST $i >/dev/null && BYOBU_BACKEND="$i" && break - done - unset i - fi - if ! $BYOBU_TEST "$BYOBU_BACKEND" >/dev/null; then + if $BYOBU_TEST tmux >/dev/null; then + BYOBU_BACKEND="tmux" + elif $BYOBU_TEST screen >/dev/null; then + BYOBU_BACKEND="screen" + else printf "%s\n" "ERROR: $PKG won't work without tmux or screen installed" 1>&2 fi fi