From c0b5bff8280a03838ff6473caf8062f9a51f1a77 Mon Sep 17 00:00:00 2001 From: Dustin Kirkland Date: Mon, 17 Mar 2014 07:59:29 +0900 Subject: [PATCH] * usr/share/byobu/profiles/bashrc: LP: #1259621 - add a visual queue in the PS1 command prompt when running as the root user; prepend "!" in front of "root" --- debian/changelog | 3 +++ usr/share/byobu/profiles/bashrc | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index fd85abb5..140af6c5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,9 @@ byobu (5.75) unreleased; urgency=medium * usr/lib/byobu/include/shutil, usr/lib/byobu/release: LP: #1278016 - /etc/issue might be modified to display corporate banners or legal warnings; try to use /etc/os-release if available + * usr/share/byobu/profiles/bashrc: LP: #1259621 + - add a visual queue in the PS1 command prompt when running as the + root user; prepend "!" in front of "root" -- Dustin Kirkland Sun, 16 Mar 2014 12:46:36 -0700 diff --git a/usr/share/byobu/profiles/bashrc b/usr/share/byobu/profiles/bashrc index 52cb1e94..71d71e81 100644 --- a/usr/share/byobu/profiles/bashrc +++ b/usr/share/byobu/profiles/bashrc @@ -26,6 +26,7 @@ if [ -n "$TMUX" ] || [ "${TERMCAP#*screen}" != "${TERMCAP}" ]; then # Ensure that we're in bash, in a byobu environment if [ -n "$BYOBU_BACKEND" ] && [ -n "$BASH" ]; then byobu_prompt_status() { local e=$?; [ $e != 0 ] && echo -e "$e "; } + byobu_root() { [ "$USER" = "root" ] && printf "%s" "!"; } case "$BYOBU_DISTRO" in "Ubuntu") # Use Ubuntu colors (grey / aubergine / orange) @@ -33,11 +34,11 @@ if [ -n "$TMUX" ] || [ "${TERMCAP#*screen}" != "${TERMCAP}" ]; then case "$BYOBU_CHARMAP" in "UTF-8") # MATHEMATICAL RIGHT DOUBLE ANGLE BRACKET (U+27EB, Pe): ⟫ - 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\]⟫ " + PS1="${debian_chroot:+($debian_chroot)}\[\e[38;5;202m\]\$(byobu_prompt_status)\[\e[38;5;245m\]\$(byobu_root)\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\]\$(byobu_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\]\$(byobu_root)\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"