aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Singleton <matt@xcolour.net>2021-02-04 09:02:34 -0600
committerMatt Singleton <matt@xcolour.net>2021-02-04 09:02:34 -0600
commit96cd574530b812fa632e9408ae1db472c4262de1 (patch)
tree54f2ea30257836c7a92b60bc5d32d618f6ac4953
parent8d3126b55c42b33fad5d1e9e64d74c7d04bc0806 (diff)
recognize alacritty as a terminal that supports setting the title and fall back cleanly if zsh pre* functions are not set
-rw-r--r--zsh/behavior.zsh2
-rw-r--r--zsh/functions.zsh-overrides6
2 files changed, 4 insertions, 4 deletions
diff --git a/zsh/behavior.zsh b/zsh/behavior.zsh
index f2be1f5..84e5bfc 100644
--- a/zsh/behavior.zsh
+++ b/zsh/behavior.zsh
@@ -22,7 +22,7 @@ setopt hist_verify # load hist into command buffer rather than exec immediately
# set term title appropriately based on term type
# user@host:current_dir (current_command)
case "$TERM" in
- xterm*|rxvt*|screen*)
+ xterm*|rxvt*|screen*|alacritty*)
term_preexec () {
printf '\e]0;%s (%s)\a' ${(%):-'%n@%m:%~'} "$1"
}
diff --git a/zsh/functions.zsh-overrides b/zsh/functions.zsh-overrides
index 9826007..8b233e5 100644
--- a/zsh/functions.zsh-overrides
+++ b/zsh/functions.zsh-overrides
@@ -1,8 +1,8 @@
preexec () {
- term_preexec $*
- theme_preexec $*
+ type term_preexec &> /dev/null && term_preexec $*
+ type theme_preexec &> /dev/null && theme_preexec $*
}
precmd () {
- term_precmd
+ type term_precmd &> /dev/null && term_precmd
}