From 153d533f70bf25e11704d2c06e2ee3d1bebe184c Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Fri, 19 Jun 2026 15:03:21 -0700 Subject: zsh: Set the current tab title when we enter a git directory --- zsh/zshrc.org | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/zsh/zshrc.org b/zsh/zshrc.org index 27af335..f89ab2d 100644 --- a/zsh/zshrc.org +++ b/zsh/zshrc.org @@ -189,14 +189,14 @@ Autoload any ZSH function from =$HOME/.zsh/functions=. colors #+end_src - Setup VCS info. + Setup VCS info. The =formats= option supports two arguments, they are the format strings for the =vcs_info_message_0_= and =vcs_info_message_1_=. The latter is used to set the title for the current wezterm (or other terminal) tab. #+begin_src sh add-zsh-hook precmd vcs_info zstyle ':vcs_info:*' actionformats '%u%c%B%F{1}%a%f%%b %F{3}%s%f:%F{5}%r%f:%F{4}%b%f' zstyle ':vcs_info:*' enable bzr git hg svn - zstyle ':vcs_info:*' formats '%u%c%F{3}%s%f:%F{5}%r%f:%F{4}%b%f' + zstyle ':vcs_info:*' formats '%u%c%F{3}%s%f:%F{5}%r%f:%F{4}%b%f' '%r' zstyle ':vcs_info:*' nvcsformats '' zstyle ':vcs_info:bzr:*' branchformat '%b' zstyle ':vcs_info:git:*' check-for-changes 1 @@ -211,6 +211,17 @@ Autoload any ZSH function from =$HOME/.zsh/functions=. RPROMPT='${vcs_info_msg_0_}' #+end_src + Set the current tab's title (for wezterm at least), to the current project directory. This is set above with the =%r= specifier. + + #+begin_src sh + function set_vcs_title() + { + printf "\\e]0;${vcs_info_msg_1_}\\a" + } + + add-zsh-hook precmd set_vcs_title + #+end_src + * Other configurations Other setups might also make ZSH files, these should all be loaded. -- cgit v1.3-2-g0d8e