From bbf4078ba540482c2042627235a3814d5259e49f Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Mon, 5 May 2008 21:54:50 +0100 Subject: [PATCH 1/1] migrate xterm-title setting to zshrc --- .zsh/zshrc/00_TODO | 5 ----- .zsh/{xterm-title => zshrc/90_xterm_title} | 8 +++++--- 2 files changed, 5 insertions(+), 8 deletions(-) rename .zsh/{xterm-title => zshrc/90_xterm_title} (91%) 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 -- 2.39.5