This commit is contained in:
Hongbo Liu 2017-05-03 15:06:13 +00:00 committed by GitHub
commit e9c4f847c6

View file

@ -68,8 +68,12 @@ function omz_termsupport_preexec {
return
fi
local cmd_ignore_pattern="*=*|sudo|ssh|mosh|rake|-*"
if [[ -n "$TABTITLE_CUSTOM_IGNORE_PATTERN" ]]; then
cmd_ignore_pattern="$cmd_ignore_pattern|$TABTITLE_CUSTOM_IGNORE_PATTERN"
fi
# cmd name only, or if this is sudo or ssh, the next cmd
local CMD=${1[(wr)^(*=*|sudo|ssh|mosh|rake|-*)]:gs/%/%%}
local CMD=${1[(wr)^($cmd_ignore_pattern)]:gs/%/%%}
local LINE="${2:gs/%/%%}"
title '$CMD' '%100>...>$LINE%<<'