From 96cd574530b812fa632e9408ae1db472c4262de1 Mon Sep 17 00:00:00 2001 From: Matt Singleton Date: Thu, 4 Feb 2021 09:02:34 -0600 Subject: recognize alacritty as a terminal that supports setting the title and fall back cleanly if zsh pre* functions are not set --- zsh/behavior.zsh | 2 +- zsh/functions.zsh-overrides | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'zsh') 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 } -- cgit v1.2.3