diff options
| author | 2026-06-19 15:03:21 -0700 | |
|---|---|---|
| committer | 2026-08-26 23:04:25 -0700 | |
| commit | 153d533f70bf25e11704d2c06e2ee3d1bebe184c (patch) | |
| tree | deb4c41d5fbcfb3d52524eb58cca99851a125596 | |
| parent | acbb07134e0d36d75a60cb9e906aac786741ded4 (diff) | |
| download | new-dotfiles-153d533f70bf25e11704d2c06e2ee3d1bebe184c.tar.gz new-dotfiles-153d533f70bf25e11704d2c06e2ee3d1bebe184c.zip | |
zsh: Set the current tab title when we enter a git directory
| -rw-r--r-- | zsh/zshrc.org | 15 |
1 files 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. |
