summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaymaekers Luca <raymaekers.luca@gmail.com>2023-04-24 12:42:10 +0200
committerRaymaekers Luca <raymaekers.luca@gmail.com>2023-04-24 12:42:10 +0200
commitafbf46a5ae8248a1718e3abe801bc87f88838bae (patch)
tree8ca818a7ee8d23fd943248d757c9e35aa7f0b6c4
parent3db0e5a18af4b06fe70edc0b13bc93c2c4d4df06 (diff)
added action to window title
-rw-r--r--config/essentials/zsh/.zshrc7
1 files changed, 6 insertions, 1 deletions
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() {