Hello folks,

I've just installed Leap 42.3, and out of curiosity I took a look at the default $PS1, which is :

Code:
:~> echo $PS1
\[$(ppwd)\]\u@\h:\w>
So I went digging around this ppwd, which appears to be a function defined in some obscure (as far as I understand) part of /etc/bash.bashrc (from line 146), where it is defined as:
Code:
    if path tput hs 2>/dev/null || path tput -T $TERM+sl hs 2>/dev/null ; then
    ... 
         ppwd () {
            local dir
            local -i width
            test -n "$TS1" || return;
            dir="$(dirs +0)"
            let width=${#dir}-18
            test ${#dir} -le 18 || dir="...${dir#$(printf "%.*s" $width "$dir")}"
            if test ${#TS1} -gt 17 ; then
                printf "$TS1" "$USER" "$HOST" "$dir" "$HOST"
            else
                printf "$TS1" "$USER" "$HOST" "$dir"
            fi
        }
    else
        ppwd () { true; }
    fi
Could someone please help me to understand better how this works, and when it is useful ?

That's my first post here, so I hope this is the right place to ask this questions !

bests,