Browse Source

optimization for windows

pull/1/head
10sr 13 years ago
parent
commit
b5bd76063d
1 changed files with 10 additions and 7 deletions
  1. +10
    -7
      .bashrc

+ 10
- 7
.bashrc View File

@@ -275,10 +275,10 @@ prompt_function(){ # used by PS1
local lastreturn=$? local lastreturn=$?
if test "${TERM}" == dumb if test "${TERM}" == dumb
then then
local c1=""
local c2=""
local c3=""
local cdef=""
local c1=
local c2=
local c3=
local cdef=
else else
local c1="\e[33m" local c1="\e[33m"
local c2="\e[36m" local c2="\e[36m"
@@ -289,19 +289,22 @@ prompt_function(){ # used by PS1
then then
local pwd=$PWD local pwd=$PWD
local oldpwd=$OLDPWD local oldpwd=$OLDPWD
if git status >/dev/null 2>&1
local jobnum=
if git branch >/dev/null 2>&1
then then
local git="[GIT]" local git="[GIT]"
else else
local git=""
local git=
fi fi
local date=$(/c/Windows/System32/cmd.exe //c 'echo %DATE%-%TIME%')
:
else else
local pwd=$(echo "${PWD}/" | sed -e "s#${HOME}#~#") local pwd=$(echo "${PWD}/" | sed -e "s#${HOME}#~#")
local oldpwd=$(echo "${OLDPWD}/" | sed -e "s#${HOME}#~#") local oldpwd=$(echo "${OLDPWD}/" | sed -e "s#${HOME}#~#")
local jobnum=$(jobs | wc -l) local jobnum=$(jobs | wc -l)
local git=$(safe-cmd __git_ps1 [GIT:%s]) local git=$(safe-cmd __git_ps1 [GIT:%s])
local date=$(LANG=C safe-cmd date +"%a, %d %b %Y %T %z")
fi fi
local date=$(LANG=C safe-cmd date +"%a, %d %b %Y %T %z")
local svn=$(type svn >/dev/null 2>&1 && safe-cmd __my_svn_ps1 [SVN:%s]) local svn=$(type svn >/dev/null 2>&1 && safe-cmd __my_svn_ps1 [SVN:%s])
printf "${_MEMO}" printf "${_MEMO}"
printf " [${c1}${pwd}${cdef}<${c3}${oldpwd}${cdef}]${git}${svn}\n" printf " [${c1}${pwd}${cdef}<${c3}${oldpwd}${cdef}]${git}${svn}\n"


Loading…
Cancel
Save