From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19502 invoked from network); 25 Mar 1998 16:10:50 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 25 Mar 1998 16:10:50 -0000 Received: (from list@localhost) by math.gatech.edu (8.8.5/8.8.5) id LAA20323; Wed, 25 Mar 1998 11:07:29 -0500 (EST) Resent-Date: Wed, 25 Mar 1998 11:03:33 -0500 (EST) Message-ID: <19980325100150.A19966@emsphone.com> Date: Wed, 25 Mar 1998 10:01:50 -0600 From: Dan Nelson To: Andrew Main , Shawn Leas Cc: thomas@wi3d01.informatik.uni-wuerzburg.de, zsh-users@math.gatech.edu Subject: Re: HPUX (was Re: vi command line editing) References: <199803251022.KAA30301@taos.demon.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.90.10i In-Reply-To: <199803251022.KAA30301@taos.demon.co.uk>; from "Andrew Main" on Wed Mar 25 10:22:49 GMT 1998 X-OS: FreeBSD 2.2.6-BETA Resent-Message-ID: <"neugG3.0.Mx4.JhI6r"@math> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/1425 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu In the last episode (Mar 25), Andrew Main said: > Shawn Leas wrote: > >bindkey -s "^[OA" "^[ka" > >bindkey -s "^[OB" "^[ja" > >bindkey -s "^[OD" "^[ha" > >bindkey -s "^[OC" "^[la" > > That's a terminal issue. Some terminals send "^[OA" instead of "^[[A". > Of course, a lot of terminals send sequences completely different from > these, but zsh should probably recognise both of these sets by default. My soution (adjust to your needs): # usage: bindtc # Binds a termcap entry to a command. If the termcap string does # not exist, use bindtc () { local keyval=$(echotc "$1" 2>&-) bindkey "${keyval:-$2}" "$3" } # Bindings for UP, DOWN, LEFT, RIGHT bindtc ku "^[[A" up-line-or-history bindtc kd "^[[B" down-line-or-history bindtc kr "^[[C" forward-char bindtc kl "^[[D" backward-char -Dan Nelson dnelson@emsphone.com