]> git.zndr.dk Git - dotfiles.git/commitdiff
Replace \n with \r in prompt
authorJannik ZANDER <jzander@grundfos.com>
Mon, 23 May 2016 19:43:38 +0000 (21:43 +0200)
committerJannik ZANDER <jzander@grundfos.com>
Mon, 23 May 2016 19:43:38 +0000 (21:43 +0200)
.config/profile/rc/prompt.sh

index d3ba0989ee896053845cc095d4a47f787cc3e7bf..9b30788e4369bb17d3185f36ee5546ee256cbe86 100644 (file)
@@ -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