From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23256 invoked from network); 2 Nov 1998 10:18:06 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 2 Nov 1998 10:18:06 -0000 Received: (from list@localhost) by math.gatech.edu (8.9.1/8.9.1) id FAA11186; Mon, 2 Nov 1998 05:11:26 -0500 (EST) Resent-Date: Mon, 2 Nov 1998 05:11:26 -0500 (EST) Message-Id: <9811020955.AA41305@ibmth.df.unipi.it> To: zsh-workers@math.gatech.edu Subject: Re: Bad bindkey mojo in 3.1.5 In-Reply-To: ""Bart Schaefer""'s message of "Sun, 01 Nov 1998 22:17:36 NFT." <981101221736.ZM29688@candle.brasslantern.com> Date: Mon, 02 Nov 1998 10:55:14 +0100 From: Peter Stephenson Resent-Message-ID: <"IafP93.0.gk2.ELOFs"@math> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/4494 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu "Bart Schaefer" wrote: > Take a look at this: > > zagzig<106> bindkey | grep back > "^B" backward-char > "^H" backward-delete-char > "^W" "^W" "^W" "^W" "^W" "^W" "^W" "^W" backward-kill-word > "^X^P" history-beginning-search-backward > "^Xr" history-incremental-search-backward > (etc.) > > Looks like "zed" tickles the bug: The problem is in zed rather than the shell. It doesn't occur with the zed supplied with 3.1.5, but obviously I'm using the same one as you (or similar, anyway), though I can't remember who altered it last. In zsh 3.1, `bindkey '^w'' produces something like "^W" kill-region then when this gets restored, the call is in effect bindkey "^W" "\"^W\" kill-region" which is obviously wrong. Zsh didn't used to print the "^W" when you asked for just one binding, hence the difference. The following fixes it under the assumption that everything up to and including 3.0.x doesn't print the key string and doesn't have -L, and conversely from then on. Restoring bindkeys is better taken care of in the zed supplied with the source, but that's specific to 3.1. I didn't put PATCH: at the top since it doesn't patch any official version of the source. It wouldn't be beyond the wit of man, err, person, to implement a .zedrc which could have arbitrary bindings in it. *** /home/user2/pws/bin/fns/zed.cw Wed Dec 3 13:35:57 1997 --- /home/user2/pws/bin/fns/zed Mon Nov 2 10:45:02 1998 *************** *** 8,14 **** # Completion: use # compctl -f -x 'w[1,-f]' -F -- zed ! local var fun ctrl_W_bind="$(bindkey '^W')" oldcompctl hist # We do not want timeout while we are editing a file integer TMOUT=0 --- 8,19 ---- # Completion: use # compctl -f -x 'w[1,-f]' -F -- zed ! local var fun oldcompctl ctrl_W_bind hist ! if [[ -z $ZSH_VERSION || $ZSH_VERSION = 3.0* ]]; then ! ctrl_W_bind="bindkey '^W' \"$(bindkey '^W')\"" ! else ! ctrl_W_bind="$(bindkey -L '^W')" ! fi # We do not want timeout while we are editing a file integer TMOUT=0 *************** *** 33,39 **** cleanup () { bindkey "^M" accept-line bindkey "^X^W" undefined-key ! bindkey "^W" "$ctrl_W_bind" [[ -n $oldcompctl ]] && eval $oldcompctl unfunction cleanup [[ -z $ZSH_VERSION ]] && unsetopt nobanghist --- 38,44 ---- cleanup () { bindkey "^M" accept-line bindkey "^X^W" undefined-key ! eval $ctrl_W_bind [[ -n $oldcompctl ]] && eval $oldcompctl unfunction cleanup [[ -z $ZSH_VERSION ]] && unsetopt nobanghist -- Peter Stephenson Tel: +39 050 844536 WWW: http://www.ifh.de/~pws/ Dipartimento di Fisica, Via Buonarotti 2, 56100 Pisa, Italy