Merge remote-tracking branch 'upstream/master'

This commit is contained in:
2015-11-19 16:18:58 +01:00
4 changed files with 127 additions and 49 deletions

View File

@@ -84,17 +84,29 @@ prompt_pure_check_git_arrows() {
[[ -n $arrows ]] && prompt_pure_git_arrows=" ${arrows}"
}
prompt_pure_set_title() {
# tell the terminal we are setting the title
print -n '\e]0;'
# show hostname if connected through ssh
[[ -n $SSH_CONNECTION ]] && print -Pn '(%m) '
case $1 in
expand-prompt)
print -Pn $2;;
ignore-escape)
print -rn $2;;
esac
# end set title
print -n '\a'
}
prompt_pure_preexec() {
# attempt to detect and prevent prompt_pure_async_git_fetch from interfering with user initiated git or hub fetch
[[ $2 =~ (git|hub)\ .*(pull|fetch) ]] && async_flush_jobs 'prompt_pure'
prompt_pure_cmd_timestamp=$EPOCHSECONDS
# tell the terminal we are setting the title
print -Pn "\e]0;"
# show hostname if connected through ssh
[[ "$SSH_CONNECTION" != '' ]] && print -Pn "(%m) "
# shows the current dir and executed command in the title when a process is active
# (use print -r to disable potential evaluation of escape characters in cmd)
print -nr "$PWD:t: $2"
print -Pn "\a"
# shows the current dir and executed command in the title while a process is active
prompt_pure_set_title 'ignore-escape' "$PWD:t: $2"
}
# string length ignoring ansi escapes
@@ -190,12 +202,8 @@ prompt_pure_precmd() {
# check for git arrows
prompt_pure_check_git_arrows
# tell the terminal we are setting the title
print -Pn "\e]0;"
# show hostname if connected through ssh
[[ "$SSH_CONNECTION" != '' ]] && print -Pn "(%m) "
# shows the full path in the title
print -Pn "%~\a"
prompt_pure_set_title 'expand-prompt' '%~'
# get vcs info
vcs_info