* usr/share/byobu/profiles/bashrc:

- save a fork, use a function for exit status, from Nick Moffit
This commit is contained in:
Dustin Kirkland 2013-11-07 10:35:13 -06:00
commit 5847a9b373
2 changed files with 6 additions and 4 deletions

2
debian/changelog vendored
View file

@ -9,6 +9,8 @@ byobu (5.63) unreleased; urgency=low
- Ubuntu themed grep colors, from Nick Moffit - Ubuntu themed grep colors, from Nick Moffit
* usr/bin/byobu-select-profile: * usr/bin/byobu-select-profile:
- point straight to the right section - 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 <kirkland@ubuntu.com> Fri, 01 Nov 2013 15:27:51 -0500 -- Dustin Kirkland <kirkland@ubuntu.com> Fri, 01 Nov 2013 15:27:51 -0500

View file

@ -25,26 +25,26 @@ esac
if [ -n "$TMUX" ] || [ "${TERMCAP#*screen}" != "${TERMCAP}" ]; then if [ -n "$TMUX" ] || [ "${TERMCAP#*screen}" != "${TERMCAP}" ]; then
# Ensure that we're in bash, in a byobu environment # Ensure that we're in bash, in a byobu environment
if [ -n "$BYOBU_BACKEND" ] && [ "$SHELL" = "/bin/bash" ]; then if [ -n "$BYOBU_BACKEND" ] && [ "$SHELL" = "/bin/bash" ]; then
byobu_prompt_status() { local e=$?; [ $e != 0 ] && echo -e "$e "; }
case "$BYOBU_DISTRO" in case "$BYOBU_DISTRO" in
"Ubuntu") "Ubuntu")
# Use Ubuntu colors (grey / aubergine / orange) # Use Ubuntu colors (grey / aubergine / orange)
[ -n "$BYOBU_CHARMAP" ] || BYOBU_CHARMAP=$(locale charmap 2>/dev/null || echo) [ -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 case "$BYOBU_CHARMAP" in
"UTF-8") "UTF-8")
# MATHEMATICAL RIGHT DOUBLE ANGLE BRACKET (U+27EB, Pe): ⟫ # 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 # 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 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" 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) # 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 esac
fi fi