From 9d05f702dfb983266b28be9ee125ef0e44bb0516 Mon Sep 17 00:00:00 2001 From: Alexander Karle Date: Sun, 18 Nov 2018 11:07:49 -0500 Subject: [PATCH] [bash] better newline after prompt I was previously appending \n to the prompt, but this makes things such as virtualenv act wonky (because they just append before the newline). Solution: set PROMPT_COMMAND environmental variable to be "echo" (runs after each issuing of PS1) --- bash/bash_prompt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bash/bash_prompt b/bash/bash_prompt index fad5e65..fe7ff1c 100644 --- a/bash/bash_prompt +++ b/bash/bash_prompt @@ -37,7 +37,7 @@ if tput setaf 1 &> /dev/null; then tput sgr0 BOLD="\[$(tput bold)\]" RESET="\[$(tput sgr0)\]" - export PS1="\n$BOLD$BLUE\w $RESET$GRAY${ssh_text}\$(parse_git_branch)"$'\n'"$BOLD$MAGENTA\$ $RESET" + export PS1="$BOLD$BLUE\w $RESET$GRAY${ssh_text}\$(parse_git_branch)"$'\n'"$BOLD$MAGENTA\$ $RESET" export PS2="$ORANGE→ $RESET" else # TODO: write better case for too few colors... @@ -49,3 +49,7 @@ else export PS1="\w\n\$ " export PS2="> " fi + +# This command runs after each issuing of PS1 +# Used to add a newline after each prompt +export PROMPT_COMMAND="echo" -- libgit2 0.28.4