From 1fc076ac82445471b270f7dfe5d9313980d58d9e Mon Sep 17 00:00:00 2001 From: Dustin Kirkland Date: Sat, 3 Aug 2013 15:03:37 -0500 Subject: [PATCH] * usr/bin/byobu-disable-prompt, usr/bin/byobu-enable-prompt, usr/share/byobu/profiles/bashrc: - don't put profile reloads in the bash history - use a ~/.byobu/prompt file as a redirect, and to enable end user customizations - fix a bash error --- debian/changelog | 6 ++++++ usr/bin/byobu-disable-prompt | 2 +- usr/bin/byobu-enable-prompt | 6 ++++-- usr/share/byobu/profiles/bashrc | 2 +- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 10c4debf..cc99c51e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,6 +7,12 @@ byobu (5.51) unreleased; urgency=low - use a common bashrc file * usr/share/byobu/profiles/bashrc: - allow override via a $DISTRO env variable + * usr/bin/byobu-disable-prompt, usr/bin/byobu-enable-prompt, + usr/share/byobu/profiles/bashrc: + - don't put profile reloads in the bash history + - use a ~/.byobu/prompt file as a redirect, and to enable + end user customizations + - fix a bash error -- Dustin Kirkland Fri, 02 Aug 2013 17:30:11 -0500 diff --git a/usr/bin/byobu-disable-prompt b/usr/bin/byobu-disable-prompt index 45f1a276..47912241 100755 --- a/usr/bin/byobu-disable-prompt +++ b/usr/bin/byobu-disable-prompt @@ -26,7 +26,7 @@ $BYOBU_SED -i -e "/#byobu-prompt#$/d" "$HOME/.bashrc" if [ "$1" != "--no-reload" ]; then if [ -n "$TMUX" ] && [ "$SHELL" = "/bin/bash" ]; then - tmux send-keys ". ~/.bashrc" \; send-keys Enter + tmux send-keys " . ~/.bashrc" \; send-keys Enter else echo echo "You will need to reload your shell configuration for this to take effect..." diff --git a/usr/bin/byobu-enable-prompt b/usr/bin/byobu-enable-prompt index 9becfba3..192bb61a 100755 --- a/usr/bin/byobu-enable-prompt +++ b/usr/bin/byobu-enable-prompt @@ -25,11 +25,13 @@ PKG="byobu" . "${BYOBU_PREFIX}/lib/${PKG}/include/common" +prompt="${BYOBU_CONFIG_DIR}/prompt" +[ -e "$prompt" ] || printf ". ${BYOBU_PREFIX}/share/${PKG}/profiles/bashrc #byobu-prompt#\n" > "$prompt" $PKG-disable-prompt --no-reload "$1" || true -printf ". ${BYOBU_PREFIX}/share/${PKG}/profiles/bashrc #byobu-prompt#\n" >> "$HOME/.bashrc" +printf "[ -r $prompt ] && . $prompt #byobu-prompt#\n" >> "$HOME/.bashrc" if [ -n "$TMUX" ]; then - tmux send-keys ". ~/.bashrc" \; send-keys Enter + tmux send-keys " . ~/.bashrc" \; send-keys Enter else echo echo "You will need to reload your shell configuration for this to take effect..." diff --git a/usr/share/byobu/profiles/bashrc b/usr/share/byobu/profiles/bashrc index 7d240351..9c6ec370 100644 --- a/usr/share/byobu/profiles/bashrc +++ b/usr/share/byobu/profiles/bashrc @@ -19,7 +19,7 @@ if [ -n "$TMUX" ] || (printf "$TERMCAP" | grep -qs "screen"); then # Ensure that we're in bash, in a byobu environment if [ -n "$BYOBU_BACKEND" ] && [ "$SHELL" = "/bin/bash" ]; then - if [-z "$DISTRO" ] && grep -qs "^Ubuntu" /etc/issue; then + if [ -z "$DISTRO" ] && grep -qs "^Ubuntu" /etc/issue; then # Use Ubuntu colors (grey / aubergine / orange) PS1="${debian_chroot:+($debian_chroot)}\[\e[38;5;245m\]\u\[\e[00m\]@\[\e[38;5;5m\]\h\[\e[00m\]:\[\e[38;5;172m\]\w\[\e[00m\]❭ " else