dotfiles/shells/bash/lib/prompt.bash

14 lines
219 B
Bash
Raw Normal View History

2011-10-25 15:05:16 +11:00
function prompt_pwd() {
if osx; then
extended="-E"
else
extended="-re"
fi
echo `pwd|sed -e "s|$HOME|~|"|sed -E "s|([^/])[^/]+/|\1/|g"`
}
2011-10-25 15:16:15 +11:00
function precmd() {
PS1="$(user_at_host)$(prompt_pwd)"
}