add custom tab title cmd ignore pattern support

This commit is contained in:
Hongbo Liu 2016-12-11 15:45:46 -05:00
commit e2703db383

View file

@ -68,8 +68,12 @@ function omz_termsupport_preexec {
return return
fi 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 # 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/%/%%}" local LINE="${2:gs/%/%%}"
title '$CMD' '%100>...>$LINE%<<' title '$CMD' '%100>...>$LINE%<<'