From 953804c25f2f004e2fb00635fde40749bfa4c7cc Mon Sep 17 00:00:00 2001 From: Dustin Kirkland Date: Fri, 2 Aug 2013 17:27:55 -0500 Subject: [PATCH] * usr/bin/byobu-disable-prompt, usr/bin/byobu-enable-prompt: - ensure we're in a tmux shell - ensure we're in a bash shell - don't double-reload --- debian/changelog | 4 ++++ usr/bin/byobu-disable-prompt | 16 +++++++++------- usr/bin/byobu-enable-prompt | 4 ++-- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/debian/changelog b/debian/changelog index 6c481c12..0a883599 100644 --- a/debian/changelog +++ b/debian/changelog @@ -14,6 +14,10 @@ byobu (5.50) unreleased; urgency=low - use a common get_distro function in a couple of places * usr/lib/byobu/wifi_quality, usr/share/man/man1/byobu.1: - make wifi status a little easier to read + * usr/bin/byobu-disable-prompt, usr/bin/byobu-enable-prompt: + - ensure we're in a tmux shell + - ensure we're in a bash shell + - don't double-reload -- Dustin Kirkland Sun, 28 Jul 2013 19:51:39 -0500 diff --git a/usr/bin/byobu-disable-prompt b/usr/bin/byobu-disable-prompt index f39330ac..efd4c387 100755 --- a/usr/bin/byobu-disable-prompt +++ b/usr/bin/byobu-disable-prompt @@ -24,13 +24,15 @@ PKG="byobu" $BYOBU_SED -i -e "/#byobu-prompt#$/d" "$HOME/.bashrc" -if [ "$BYOBU_BACKEND" = "tmux" ]; then - tmux send-keys ". ~/.bashrc" \; send-keys Enter -else - echo - echo "You will need to reload your shell configuration for this to take effect..." - echo " . ~/.bashrc" - echo +if [ "$1" != "--no-reload" ]; then + if [ -n "$TMUX" ] && [ "$SHELL" = "/bin/bash" ]; then + tmux send-keys ". ~/.bashrc" \; send-keys Enter + else + echo + echo "You will need to reload your shell configuration for this to take effect..." + echo " . ~/.bashrc" + echo + fi fi # vi: syntax=sh ts=4 noexpandtab diff --git a/usr/bin/byobu-enable-prompt b/usr/bin/byobu-enable-prompt index 1867ea0e..8d8e717f 100755 --- a/usr/bin/byobu-enable-prompt +++ b/usr/bin/byobu-enable-prompt @@ -24,7 +24,7 @@ PKG="byobu" get_distro DISTRO="$_RET" -byobu-disable-prompt || true +byobu-disable-prompt --no-reload || true case $DISTRO in Ubuntu*) cat >>"$HOME/.bashrc" <