Return to BSD News archive
Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.rmit.EDU.AU!news.unimelb.EDU.AU!munnari.OZ.AU!spool.mu.edu!howland.reston.ans.net!rail.news.pipex.net!pipex!tube.news.pipex.net!pipex!lade.news.pipex.net!pipex!tank.news.pipex.net!pipex!news.mathworks.com!newsfeed.internetmci.com!news.sprintlink.net!new-news.sprintlink.net!news.sunquest.com!ermintrude.sunquest.com!tony From: tony@ermintrude.sunquest.com (Tony Jones) Newsgroups: comp.unix.shell,comp.unix.bsd.freebsd.misc Subject: ksh93 key binding question (freebsd/bsdi emulation) Date: 26 Apr 1996 17:57:49 GMT Organization: Sunquest Information Systems, Inc. Lines: 44 Message-ID: <4lr2qt$1no@odin.sunquest.com> NNTP-Posting-Host: ermintrude.sunquest.com X-Newsreader: TIN [version 1.2 PL2] Xref: euryale.cc.adfa.oz.au comp.unix.shell:32100 comp.unix.bsd.freebsd.misc:18232 Hi, I'm playing with the ksh93 example from Korn p98 which uses the KEYBD trap and a function 'keybind' to load bindings. Running FreeBSD 2.1-stable using the BSDI binary from the AT&T site. The manual mentions for VI mode, that an escape character must be followed by it's arguments within 1/2 of a second. Calling "keybind $'\E[A' 'k'" sets my up-arrow binding. Adding some debugging to the KEYBD trap shows that the '<escape>', '[' and 'A' characters are being processed seperately (three seperate calls to the KEYBD trap), and thus no match is made in the Keytable associative array. Since the \E[A sequence is generated by a single uparrow keystroke, I'd have expected it to fall within the 1/2 second rule mentioned above. Anyone have any ideas as to what is going wrong ? tony ------------------------------------------------------------------------------- typeset -A Keytable trap 'eval "${Keytable[${.sh.edchar}]}"' KEYBD function keybind # key action { set -x typeset key=$(print -f "%q" "$2") case $# in 2) Keytable[$1]=' .sh.edchar=${.sh.edmode}'"$key" ;; 1) unset Keytable[$1] ;; *) print -u2 "Usage: $0 key [action]" ;; esac } keybind $'\E[D' $'h' keybind $'\E[C' $'l' keybind $'\E[B' $'j' keybind $'\E[A' $'k'