diff --git a/debian/changelog b/debian/changelog index 168d36d8..b4c8465c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,6 +7,8 @@ byobu (4.6) unreleased; urgency=low - seems that ctrl-F6 doesn't work in tty right now * usr/bin/byobu-launch: - merge history + * usr/bin/byobu-launch: + - move the location of the BYOBU_DISABLE test -- Dustin Kirkland Thu, 26 May 2011 15:14:52 -0500 diff --git a/usr/bin/byobu-launch b/usr/bin/byobu-launch index 463fd6e1..c552614e 100755 --- a/usr/bin/byobu-launch +++ b/usr/bin/byobu-launch @@ -19,30 +19,35 @@ PKG="byobu" DATA="$HOME/.$PKG" -case "$-" in - *i*) - # Attempt to merge history across screen sessions/windows (works with a few exceptions) - shopt -s histappend || true - [ -n "$PROMPT_COMMAND" ] && PROMPT_COMMAND="$PROMPT_COMMAND;history -a" || PROMPT_COMMAND="history -a" - # Respect a BYOBU_DISABLE environment variable - # To use over SSH, you must: - # 1) On your remote SSH server (might be handled by your distro): - # /etc/ssh/sshd_config: AcceptEnv LANG LC_* BYOBU_DISABLE - # 2) On your local SSH client (might be handled by your distro): - # /etc/ssh/ssh_config: SendEnv LANG LC_* BYOBU_DISABLE - # 3) And in your local bashrc: - # $HOME/.bashrc: export BYOBU_DISABLE=1 - if [ "$BYOBU_DISABLE" != "1" ] && byobu-launcher; then - # Wait very briefly for the no-logout flag to get written? - sleep 0.1 - if [ -e "$DATA/no-logout-on-detach" ] || [ -e "/var/run/screen/S-$USER/byobu.no-logout" ]; then - # The user does not want to logout on byobu detach - rm -f "/var/run/screen/S-$USER/byobu.no-logout" # Remove one-time no-logout flag, if it exists - true - else - exit 0 + +# Respect a BYOBU_DISABLE environment variable +# To use over SSH, you must: +# 1) On your remote SSH server (might be handled by your distro): +# /etc/ssh/sshd_config: +# AcceptEnv LANG LC_* BYOBU_DISABLE +# 2) On your local SSH client (might be handled by your distro): +# /etc/ssh/ssh_config: +# SendEnv LANG LC_* BYOBU_DISABLE +# 3) And in your local bashrc: +# $HOME/.bashrc: export BYOBU_DISABLE=1 +if [ "$BYOBU_DISABLE" != 1 ]; then + case "$-" in + *i*) + # Attempt to merge shell history across sessions/windows (works with a few exceptions) + shopt -s histappend || true + [ -n "$PROMPT_COMMAND" ] && PROMPT_COMMAND="$PROMPT_COMMAND;history -a" || PROMPT_COMMAND="history -a" + if byobu-launcher; then + # Wait very briefly for the no-logout flag to get written? + sleep 0.1 + if [ -e "$DATA/no-logout-on-detach" ] || [ -e "/var/run/screen/S-$USER/byobu.no-logout" ]; then + # The user does not want to logout on byobu detach + rm -f "/var/run/screen/S-$USER/byobu.no-logout" # Remove one-time no-logout flag, if it exists + true + else + exit 0 + fi fi - fi - ;; -esac + ;; + esac +fi true