Joined 13 years ago
# truncate the $PWD function cut_pwd { newPWD="${PWD/#$HOME/\~}" local pwdmaxlen=$((${COLUMNS:-80}/4)) if [ ${#newPWD} -gt $pwdmaxlen ] then newPWD=".+${newPWD: -$pwdmaxlen}" fi } PROMPT_COMMAND=cut_pwd PS1="\h:\${newPWD} \\$ "