From 26342e882ac17b96f21642e2f6ea504a087380fc Mon Sep 17 00:00:00 2001 From: David Alexander Majnemer Date: Tue, 25 Nov 2008 13:12:10 -0600 Subject: [PATCH] - we consider a word to be alphanumeric for moving on the command line - make the new title thing work better, it is not flawless but not too bad --- zshrc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/zshrc b/zshrc index 0b0931c..63f5a16 100644 --- a/zshrc +++ b/zshrc @@ -16,6 +16,9 @@ fi autoload -U edit-command-line zle -N edit-command-line +# only alphanumeric chars for moving around +WORDCHARS='' + # disable core dumps limit coredumpsize 0 @@ -216,11 +219,13 @@ preexec() # Old approach: cmd=(builtin jobs -l %+) # weakness: shows a load of bs title ${jobtexts[${(k)jobstates[(R)*+*]}]%% *} "$termtitle ${jobtexts[${(k)jobstates[(R)*+*]}]}" - else + elif (( $#cmd == 2 )); then # Replace the command name, ignore extra args. # Old approach: cmd=(builtin jobs -l ${(Q)cmd[2]}) # weakness: shows all matching jobs on the title, not just one title "${jobtexts[${cmd[2]#%}]%% *}" "$termtitle $jobtexts[${cmd[2]#%}]" + else + title "${cmd[2,-1]#%}" "$termtitle ${cmd[2,-1]#%}" fi ;; %*)