Permalink
Browse files

!put git branch in prompt. if svn dir say svn

  • Loading branch information...
1 parent b38eed4 commit 258ab17744d00b08bc5836909b0086f3c4d76234 @isao committed Apr 18, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 tcsh/terminal.tcsh
View
5 tcsh/terminal.tcsh
@@ -59,7 +59,10 @@ switch ($TERM)
# %# promptchars shell var; '#', '>', or '%', etc.
# %L clear to eol or eop
# !# history substution of current event
- set prompt = '%{\033]0;%n@%m:%c03\007%}%T%n%# %L'
+ #set prompt = '%{\033]0;%n@%m:%c03\007%}%T%n%# %L'
+ setenv VCS 'sh -c "(test -d .svn && echo ..svn || git branch --no-color 2> /dev/null) | cut -c3-33"'
+ sched +0:00 alias precmd 'set prompt="%{\033]0;%n@%m:%c03\007%}%T%n%B`$VCS`%b%# "'
+
# currently running command(s)
sched +0:00 alias postcmd 'printf "\033]0;%s %s\007" `hostname -s` "\!#"'
breaksw

0 comments on commit 258ab17

Please sign in to comment.