Skip to content

Commit

Permalink
windows title
Browse files Browse the repository at this point in the history
  • Loading branch information
lovef committed Mar 24, 2019
1 parent 9ff5ff7 commit 3a60d80
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions windows/.bash_profile
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,6 @@
dir=$( dirname "${BASH_SOURCE[0]}" )
fullpath="$( cd $dir ; pwd -P )"

export PS1_WITH_GIT='\[\033]0;$TITLEPREFIX:${PWD//[^[:ascii:]]/?}\007\]\n\[\033[32m\]\A \u@\h \[\033[33m\]\w\[\033[36m\]`__git_ps1 " --> %s"`\[\033[0m\]\n$ '
export PS1_WITHOUT_GIT='\[\033]0;$TITLEPREFIX:${PWD//[^[:ascii:]]/?}\007\]\n\[\033[32m\]\A \u@\h \[\033[33m\]\w\[\033[0m\]\n$ '
export GIT_PS1_SHOWDIRTYSTATE=1
alias ps1_with_git='export PS1=$PS1_WITH_GIT'
alias ps1_without_git='export PS1=$PS1_WITHOUT_GIT'
ps1_without_git
command -v __git_ps1 >/dev/null 2>&1 && ps1_with_git

alias open='start'

function explorer {
Expand All @@ -37,5 +29,14 @@ function pathsToWin {
command -v powershell >/dev/null 2>&1 && alias say='powershell -File "$(cygpath -w "${fullpath}/speach.ps1")"'

function title {
conemu -n "$*"
if [ ! -z "$*" ]; then
export PS1='\n\[\033[32m\]\A \u@\h \[\033[33m\]\w\[\033[36m\]`__git_ps1 " --> %s"`\[\033[0m\]\n$ '
echo -ne "\033]0;"$*"\007"
else
export PS1='\[\033]0;$TITLEPREFIX:${PWD//[^[:ascii:]]/?}\007\]\n\[\033[32m\]\A \u@\h \[\033[33m\]\w\[\033[36m\]`__git_ps1 " --> %s"`\[\033[0m\]\n$ '
title_set=false
fi
}

export GIT_PS1_SHOWDIRTYSTATE=1
title

0 comments on commit 3a60d80

Please sign in to comment.