diff --git a/debian/changelog b/debian/changelog index e4b8baf4..578f48ff 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,6 +9,8 @@ byobu (5.63) unreleased; urgency=low - Ubuntu themed grep colors, from Nick Moffit * usr/bin/byobu-select-profile: - point straight to the right section + * usr/share/byobu/profiles/bashrc: + - save a fork, use a function for exit status, from Nick Moffit -- Dustin Kirkland Fri, 01 Nov 2013 15:27:51 -0500 diff --git a/usr/share/byobu/profiles/bashrc b/usr/share/byobu/profiles/bashrc index eb7f9078..87f6cbcd 100644 --- a/usr/share/byobu/profiles/bashrc +++ b/usr/share/byobu/profiles/bashrc @@ -25,26 +25,26 @@ esac if [ -n "$TMUX" ] || [ "${TERMCAP#*screen}" != "${TERMCAP}" ]; then # Ensure that we're in bash, in a byobu environment if [ -n "$BYOBU_BACKEND" ] && [ "$SHELL" = "/bin/bash" ]; then + byobu_prompt_status() { local e=$?; [ $e != 0 ] && echo -e "$e "; } case "$BYOBU_DISTRO" in "Ubuntu") # Use Ubuntu colors (grey / aubergine / orange) [ -n "$BYOBU_CHARMAP" ] || BYOBU_CHARMAP=$(locale charmap 2>/dev/null || echo) - PROMPT_COMMAND='prompt_status="$? "; if [[ $prompt_status == "0 " ]]; then prompt_status=; fi' case "$BYOBU_CHARMAP" in "UTF-8") # MATHEMATICAL RIGHT DOUBLE ANGLE BRACKET (U+27EB, Pe): ⟫ - PS1="${debian_chroot:+($debian_chroot)}\[\e[38;5;202m\]\$prompt_status\[\e[38;5;245m\]\u\[\e[00m\]@\[\e[38;5;5m\]\h\[\e[00m\]:\[\e[38;5;172m\]\w\[\e[00m\]⟫ " + PS1="${debian_chroot:+($debian_chroot)}\[\e[38;5;202m\]\$(byobu_prompt_status)\[\e[38;5;245m\]\u\[\e[00m\]@\[\e[38;5;5m\]\h\[\e[00m\]:\[\e[38;5;172m\]\w\[\e[00m\]⟫ " ;; *) # Simple ASCII greater-than sign - PS1="${debian_chroot:+($debian_chroot)}\[\e[38;5;202m\]\$prompt_status\[\e[38;5;245m\]\u\[\e[00m\]@\[\e[38;5;5m\]\h\[\e[00m\]:\[\e[38;5;172m\]\w\[\e[00m\]> " + PS1="${debian_chroot:+($debian_chroot)}\[\e[38;5;202m\]\$(byobu_prompt_status)\[\e[38;5;245m\]\u\[\e[00m\]@\[\e[38;5;5m\]\h\[\e[00m\]:\[\e[38;5;172m\]\w\[\e[00m\]> " ;; esac export GREP_COLORS="ms=01;38;5;202:mc=01;31:sl=:cx=:fn=01;38;5;132:ln=32:bn=32:se=00;38;5;242" ;; *) # Use Byobu colors (green / blue / red) - PS1="${debian_chroot:+($debian_chroot)}\[\e[31m\]\$prompt_status\[\e[00;32m\]\u\[\e[00m\]@\[\e[00;36m\]\h\[\e[00m\]:\[\e[00;31m\]\w\[\e[00m\]\$ " + PS1="${debian_chroot:+($debian_chroot)}\[\e[31m\]\$(byobu_prompt_status)\[\e[00;32m\]\u\[\e[00m\]@\[\e[00;36m\]\h\[\e[00m\]:\[\e[00;31m\]\w\[\e[00m\]\$ " ;; esac fi