From: Jannik ZANDER Date: Mon, 23 May 2016 19:43:38 +0000 (+0200) Subject: Replace \n with \r in prompt X-Git-Url: https://git.zndr.dk/?a=commitdiff_plain;h=5ad92f1895da1504838dbdc86308214323a411ec;p=dotfiles.git Replace \n with \r in prompt --- diff --git a/.config/profile/rc/prompt.sh b/.config/profile/rc/prompt.sh index d3ba098..9b30788 100644 --- a/.config/profile/rc/prompt.sh +++ b/.config/profile/rc/prompt.sh @@ -145,12 +145,11 @@ set_prompts() hostStyle="\[$yellow\]" fi - if [ -n "${BASH_VERSION}" ]; then - - # Set the terminal title to the current working directory. - PS1="\[\033]0;\w\007\]" + # Set the terminal title to the current working directory. + PS1="\[\033]0;\w\007\]" - PS1+=$'\n' # newline + if [ -n "${BASH_VERSION}" ]; then + PS1+=$'\r' # carriage return PS1+="\[$userStyle\]\u" # username PS1+="\[$reset$white\] at " PS1+="\[$hostStyle\]\h" # host @@ -164,8 +163,10 @@ set_prompts() PS2="\[${yellow}\]→ " # `→` PS2+="\[${reset}\]" # reset color else - PS1="\u at \h in \w on \$(__git_ps1 %s])" + PS1+=$'\r' # carriage return + PS1+="\u at \h in \w on \$(__git_ps1 %s])" PS1+=$'\n''\$ ' + PS2="→ " fi