Easier to read blue colour in terminals.
[profile.git] / .profile.d / ps1.bashrc
index 7bd93b7..991095b 100644 (file)
@@ -200,7 +200,8 @@ function __ps1_colon() {
 }
 
 function __ps1_short() {
-  local pwd=${PWD/#$HOME/\~}
+  local home=${HOME%%/}
+  local pwd=${PWD/#$home/\~}
   local dirtrim=${PROMPT_DIRTRIM//[^0-9]/}
 
   if [ "${dirtrim:0:1}" = "0" ]; then
@@ -239,7 +240,8 @@ function __ps1_short() {
     n=$((n+1))
   done
 
-  echo "$short$dirname"
+  [ "${short:0:1}" = "~" ] || short="/$short"
+  echo "$short/$dirname"
   return $1
 }