Skip to content

Instantly share code, notes, and snippets.

@fcamel
Created June 30, 2009 03:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fcamel/137978 to your computer and use it in GitHub Desktop.
Save fcamel/137978 to your computer and use it in GitHub Desktop.
function set_hg_rep() {
hg_rep=$(pwd | awk -F/ '{ print $5 }')
if [ "$hg_rep" != "" ]; then
hg_rep="(\033[1;31m$(pwd | awk -F/ '{ print $5 }')\033[m)"
fi
export PS1="[\u@wiki \w $hg_rep]\n$ "
}
function my_cd() {
\cd $1 && set_hg_rep
}
alias cd=my_cd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment