]> git.madduck.net Git - etc/zsh.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

migrate xterm-title setting to zshrc
authormartin f. krafft <madduck@madduck.net>
Mon, 5 May 2008 20:54:50 +0000 (21:54 +0100)
committermartin f. krafft <madduck@madduck.net>
Mon, 5 May 2008 20:54:50 +0000 (21:54 +0100)
.zsh/zshrc/00_TODO
.zsh/zshrc/90_xterm_title [moved from .zsh/xterm-title with 91% similarity]

index 902c9ea377f567783b82e10ee6e6e88071fcde39..2a6d13b67a85e1ece68f6d78c1663903a6e5d13e 100644 (file)
@@ -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`
similarity index 91%
rename from .zsh/xterm-title
rename to .zsh/zshrc/90_xterm_title
index 631c6515c60d8a7a0dcc901e4933dcd17e93e9f8..e700aa1cf256e761407bbec065c749c5f3ffdf03 100644 (file)
@@ -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