Yes, the problem is with this substitution: ${PWD/$HOME/~}. It does not
require a trailing / or end of string, so it will happily replace
christopher with ~topher...

In my .bashrc I use the following:
        local PWD2=""
        [[ "$PWD" == "$HOME" ]] && PWD2="~"
        [[ -z "$PWD2" ]] && [[ "$PWD" == "$HOME/" ]] && PWD2="~/"
        [[ -z "$PWD2" ]] && PWD2="${PWD/#$HOME\//~/}"


** Changed in: bash (Ubuntu)
       Status: Confirmed => Triaged

-- 
gnome terminal ~ replacement
https://bugs.launchpad.net/bugs/210405
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to