Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

More bindkey weirdness in 3.0.5



You can probably guess what got me started on this.  Anyway, consider the
output of the following function (which must be run in a freshly-started
zsh -f or it is likely to exit prematurely due to the previous bug):

bindfoo () {
        bindkey -v
	# If the next line is uncommented, zsh crashes a few commands later
	# bindkey -r '\e'
	echo +++ BEGIN +++ ; bindkey
        bindkey -r '\e[A'
        bindkey -r '\e[B'
        bindkey -r '\e[C'
        bindkey -r '\e[D'
        echo +++ REMOVED +++ ; bindkey
        bindkey "[A" up-line-or-history
        bindkey "[B" down-line-or-history
        bindkey "[C" forward-char
        bindkey "[D" backward-char
        echo +++ ADDED 1 +++ ; bindkey
        bindkey -a "[A" up-line-or-history
        bindkey -a "[B" down-line-or-history
        bindkey -a "[C" forward-char
        bindkey -a "[D" backward-char
        echo +++ ADDED 2 +++ ; bindkey
        bindkey -a '\e[A' up-line-or-history
        bindkey -a '\e[B' down-line-or-history
        bindkey -a '\e[C' forward-char
        bindkey -a '\e[D' backward-char
        echo +++ ADDED 3 +++ ; bindkey
        bindkey -e
}

Following "+++ BEGIN +++", we have (in part):

"^["    prefix
"^["    vi-cmd-mode
"^[[A"  up-line-or-history
"^[[B"  down-line-or-history
"^[[C"  forward-char
"^[[D"  backward-char

Following "+++ REMOVED +++" (so far so good):

"^["    vi-cmd-mode

Following "+++ ADDED 1 +++" (first bug):

"^["    vi-cmd-mode
"["     prefix
"[A"    self-insert			<--- WHAT?
"[B"    down-line-or-history
"[C"    forward-char
"[D"    backward-char

Following "+++ ADDED 2 +++" (where'd "[A" go?):

"^["    vi-cmd-mode
"["     prefix
"[B"    down-line-or-history
"[C"    forward-char
"[D"    backward-char

Finally, following "+++ ADDED 3 +++':

"^["    vi-cmd-mode
"["     prefix
"^[[A"  vi-cmd-mode			<-- WHAT?
"^[[B"  down-line-or-history
"^[[C"  forward-char
"^[[D"  backward-char
"[B"    down-line-or-history
"[C"    forward-char
"[D"    backward-char

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



Messages sorted by: Reverse Date, Date, Thread, Author