From: martin f. krafft Date: Mon, 5 May 2008 20:54:50 +0000 (+0100) Subject: migrate xterm-title setting to zshrc X-Git-Url: https://git.madduck.net/etc/zsh.git/commitdiff_plain/bbf4078ba540482c2042627235a3814d5259e49f?hp=5838b305850a8bd1e0d7d4701986fae648858a08 migrate xterm-title setting to zshrc --- diff --git a/.zsh/zshrc/00_TODO b/.zsh/zshrc/00_TODO index 902c9ea..2a6d13b 100644 --- a/.zsh/zshrc/00_TODO +++ b/.zsh/zshrc/00_TODO @@ -31,11 +31,6 @@ typeset -ga preexec_functions typeset -ga precmd_functions typeset -ga chpwd_functions -. $ZDOTDIR/xterm-title - -precmd_functions+=set_plain_xterm_title -preexec_functions+=set_cmd_xterm_title - [ "$(umask)" = 022 ] && umask 0077 eval `lesspipe 2>/dev/null` diff --git a/.zsh/xterm-title b/.zsh/zshrc/90_xterm_title similarity index 91% rename from .zsh/xterm-title rename to .zsh/zshrc/90_xterm_title index 631c651..e700aa1 100644 --- a/.zsh/xterm-title +++ b/.zsh/zshrc/90_xterm_title @@ -31,14 +31,15 @@ __get_session_flags() { } __get_standard_prompt() { - print -P "%m%# %25\<..\<%~ $(__get_session_flags)" + print -P "%m%#%25\<..\<%~ $(__get_session_flags)" } -set_plain_xterm_title() { +_set_plain_xterm_title() { __set_xterm_title "$(__get_standard_prompt)" } +precmd_functions+=_set_plain_xterm_title -set_cmd_xterm_title () { +_set_cmd_xterm_title () { local -a cmd; cmd=(${(z)1}) # Re-parse the command line # Construct a command that will output the desired job number. @@ -66,5 +67,6 @@ set_cmd_xterm_title () { __set_xterm_title $leader$cmd[1]:t${cmd[2]:+ }$cmd[2,-1] "| $(__get_standard_prompt)" ) } +preexec_functions+=_set_cmd_xterm_title # vim:ft=zsh