Permalink
Browse files

clean up prompt a little bit

  • Loading branch information...
isaacs committed Feb 9, 2017
1 parent a8725ba commit 8ed9c51be9edc41a093dbc2720f61d2b28b7b043
Showing with 10 additions and 10 deletions.
  1. +2 −6 .extra.bashrc
  2. +8 −4 .git-completion
View
@@ -13,10 +13,6 @@
main () {
#echo 'start ' $(/usr/local/bin/node -p 'Date.now()') >> ~/login_timing
-if [ "${BASH_EXTRAS_LOADED}" = "" ] && [ "$TERM_PROGRAM" != "DTerm" ] && [ "$PS1" != "" ]; then
- echo "loading bash extras..."
-fi
-
# I actually frequently forget this.
age () {
node -p <<JS
@@ -665,13 +661,13 @@ __prompt () {
HOST=${HOST%.local}
echo -ne "\033]0;$(__git_ps1 "%s - " 2>/dev/null)host $HOST : dir$DIR\007"
# echo -ne "$(__git_ps1 "%s " 2>/dev/null)"
- echo -ne "$(__git_ps1 "\033[40;30m[\033[40;35m%s\033[40;30m]\033[0m" 2>/dev/null)"
+ echo -ne "$(__git_ps1 "\033[40;35m%s\033[40;30m>\033[0m" 2>/dev/null)"
echo -ne "\033[44;37m$HOST\033[0m:$DIR"
# echo -ne "$USER@$HOST:$DIR"
if [ "$NAVE" != "" ]; then echo -ne " \033[44;37mnode@$NAVE\033[0m"
else echo -ne " \033[32mnode@$(node -v 2>/dev/null)\033[0m"
fi
- [ -f package.json ] && echo -ne "$(node -e 'j=require("./package.json");if(j.name&&j.version)console.log(" \033[35m"+j.name+"@"+j.version+"\033[0m")')"
+ # [ -f package.json ] && echo -ne "$(node -e 'j=require("./package.json");if(j.name&&j.version)console.log(" \033[35m"+j.name+"@"+j.version+"\033[0m")')"
}
if [ "$PROMPT_COMMAND" = "" ]; then
View
@@ -117,19 +117,23 @@ __git_ps1 ()
-e 's|\.com\:|:|' \
-e 's|^git\.||' \
-e 's|\.git$||' \
- -e 's|^github:|gh:|' \
+ -e 's|^https://github.com/|gh:|' \
+ -e 's|^http://github.com/|gh:|' \
+ -e 's|^github:||' \
-e 's|^nodejs.org:~/|n:|' \
- -e 's|^https?://github.com/|gh:|' \
-e 's|^joyent:|j:|' \
-e 's|^node@|n:|' \
- -e 's|:isaacs/|:|' \
-e 's|.no.de:repo$||' \
2>/dev/null )
then
if [ "$n" == "" ]; then
n=$(basename $PWD)
fi
- b="$n/$b"
+ if [ "$b" == "master" ]; then
+ b="$n"
+ else
+ b="$n $b"
+ fi
fi
if [ -n "$1" ]; then

0 comments on commit 8ed9c51

Please sign in to comment.