From 3cecafce41d037d28d27dd5bf20bb762e7f0f89c Mon Sep 17 00:00:00 2001 From: Alex Karle Date: Tue, 23 Feb 2021 15:56:56 -0500 Subject: [PATCH] bash: Move user@host before git-branch/status in PS1 --- .bashrc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.bashrc b/.bashrc index 227dbf7..5421054 100644 --- a/.bashrc +++ b/.bashrc @@ -46,7 +46,7 @@ if [ -n "$PRETTY_COLORS" ]; then } git_info() { - echo "$(git branch --show-current 2>/dev/null)$(parse_git_dirty)" + echo " $(git branch --show-current 2>/dev/null)$(parse_git_dirty)" } # Preferred Prompt: fancy with colors from tput @@ -60,11 +60,11 @@ if [ -n "$PRETTY_COLORS" ]; then BOLD="\[$(tput bold)\]" RESET="\[$(tput sgr0)\]" - PS1_TOP="$BOLD$RED\$(last_err)$BLUE\w $RESET$GRAY\$(git_info) [\u@\h]" + PS1_TOP="$BOLD$RED\$(last_err)$BLUE\w $RESET$GRAY[\u@\h]\$(git_info)" PS1="$PS1_TOP\n$BOLD$MAGENTA\$ $RESET" PS2="$YELLOW> $RESET" else - PS1="\$(last_err)\w \$(git_info) [\u@\h]\n\$ " + PS1="\$(last_err)\w [\u@\h]\$(git_info)\n\$ " fi fi -- libgit2 0.28.4