X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=.profile.d%2Fps1.bashrc;h=991095bcca59aad63effe4eba9dcfef4b4e5c407;hb=730f97068308dceebb2d269070701533ec22a9c9;hp=7bd93b7355ca02ab40501bcab65dc55325b1e8e8;hpb=a5faa5cee1dcee79c1d576559f892333e6539d24;p=profile.git diff --git a/.profile.d/ps1.bashrc b/.profile.d/ps1.bashrc index 7bd93b7..991095b 100644 --- a/.profile.d/ps1.bashrc +++ b/.profile.d/ps1.bashrc @@ -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 }