From afbf46a5ae8248a1718e3abe801bc87f88838bae Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Mon, 24 Apr 2023 12:42:10 +0200 Subject: added action to window title --- config/essentials/zsh/.zshrc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'config/essentials/zsh') diff --git a/config/essentials/zsh/.zshrc b/config/essentials/zsh/.zshrc index 6fc601c..ef11748 100644 --- a/config/essentials/zsh/.zshrc +++ b/config/essentials/zsh/.zshrc @@ -83,9 +83,14 @@ add-zsh-hook -Uz precmd rehash_precmd PS1=' %B%(#.%F{1}.%F{13})[%n%b%f@%B%F{6}%m]%b%f %3~ ' RPROMPT='%F{blue}$(parse_git_remote)%f%F{red}$(parse_git_status)%f%F{green}$(parse_git_branch)%f%(?.. %?)' -precmd () { +set_wt_action () { + print -Pn "\e]0;$USER@$HOST on ${PWD//$HOME/\~} | $1\a" +} +add-zsh-hook -Uz preexec set_wt_action +set_wt () { print -Pn "\e]0;$USER@$HOST on ${PWD//$HOME/\~}\a" } +add-zsh-hook -Uz precmd set_wt setopt prompt_subst parse_git_remote() { -- cgit v1.2.3