You are not logged in.
So, i'm trying to set the title to the currently running program in tmux AND restore the title to "zsh" when the program terminates.
So far I have this:
~/.zshrc
case $TERM in
screen*)
preexec(){
printf '\033k'$(echo $1 | cut -d" " -f1)'\033\\'
}
;;
esacThis sets the title of the "tab" correctly. However, it's not resetting the title to "zsh", when the program finishes.
How do I accomplish this?
I've seen some mentioning of a postexec-function, but I can't really figure out where to place it.
Does anyone have any ideas how to make this work?
Last edited by graph (2012-06-28 19:28:52)
Offline
Not exactly what you ask for, but my config sets the title to the current path, and do get reset after a command exits. See link in signature for the config.
Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest
Offline
I got it working now, by studying you .zshrc, Mr.Elendig (norwegian?).
~/.zshrc
case $TERM in
screen*)
precmd(){
# Restore tmux-title to 'zsh'
printf "\033kzsh\033\\"
# Restore urxvt-title to 'zsh'
print -Pn "\e]2;zsh:%~\a"
}
preexec(){
# set tmux-title to running program
printf "\033k$(echo "$1" | cut -d" " -f1)\033\\"
# set urxvt-title to running program
print -Pn "\e]2;zsh:$(echo "$1" | cut -d" " -f1)\a"
}
;;
esacLast edited by graph (2012-06-28 19:31:23)
Offline