I can't remember where, but I've already seen the bash prompt's current path shortened in an interesting way: every directory contained in the path (excepted the last one) is replaced by its first letter only. For instance: path/to/some/directory
would be shortened to p/t/s/directory
.
How can I reproduce that behavior ?
PS1
. You would need to setPS1
to contain a variable (PS1='${SHORT_PWD}\\$'
) and update that variable in$PROMPT_COMMAND
.\$()
command substitutions though