Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com> List-Archive: <http://sources.redhat.com/ml/cygwin/> List-Post: <mailto:cygwin AT cygwin DOT com> List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs> Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-Id: <5.2.0.9.2.20030215075349.01da3a48@pop3.cris.com> X-Sender: rrschulz AT pop3 DOT cris DOT com Date: Sat, 15 Feb 2003 08:02:24 -0800 To: cygwin AT cygwin DOT com From: Randall R Schulz <rrschulz AT cris DOT com> Subject: Re: The humble <DEL> and other editing keys In-Reply-To: <028b01c2d4c4$4ff06bb0$0b01a8c0@w2k30g> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed David, Key sequence generation is not a shell issue, it's defined by the terminal emulator which gets key-codes from the OS and generates sequences of bytes to send through a pseudo-tty to whatever application (shell or otherwise) that's reading. Likewise, it interprets things like cursor-addressing or color-changing sequences written by user-level (controlling side of the pseudo-tty) and then issues appropriate system or library calls to produce the requested display effects. Generally, terminal emulators pick a commercial terminal product (if such things still exist) or simply use the ANSI terminal control standard and implement the sequences defined by that product or standard. I usually use "od -c" to discover what a key is sending under a particular terminal emulator. My "~/.inputrc" file shows where the Cygwin console and Cygwin RXVT differ for the Fn keys and the six keys in the Insert-PageDown cluster above the arrow keys. Fortunately, there's no conflict between the two: # Console: # F1 - F5 "\M-[[A" "fg %1\C-M" "\M-[[B" "fg %2\C-M" "\M-[[C" "fg %3\C-M" "\M-[[D" "fg %4\C-M" "\M-[[E" "fg %5\C-M" # RXVT: # F1 - F5 "\M-[11~" "fg %1\C-M" "\M-[12~" "fg %2\C-M" "\M-[13~" "fg %3\C-M" "\M-[14~" "fg %4\C-M" "\M-[15~" "fg %5\C-M" # Both Console and RXVT: # F6 - F12 "\M-[17~" "fg %6\C-M" "\M-[18~" "fg %7\C-M" "\M-[19~" "fg %8\C-M" "\M-[20~" "fg %9\C-M" "\M-[21~" "fg %10\C-M" "\M-[23~" "fg %11\C-M" "\M-[24~" "fg %-\C-M" # Console: "\M-[1~": beginning-of-line # Home "\M-[4~": end-of-line # End # RXVT: "\M-[7~": beginning-of-line # Home "\M-[8~": end-of-line # End # Both Console and RXVT: "\M-[2~": paste-from-clipboard # Insert # "\M-[5~" # Page-Up "\M-[3~": delete-char # Delete # "\M-[6~" # Page-Down Randall Schulz At 23:31 2003-02-14, David Christensen wrote: >Elfyn McBratney wrote on 14 Feb 2003 18:18:47 -0000 > > In bash you can add the following > > > > # DEL key in bash > > "\e[3~": delete-char > > > > to your ~/.inputrc or your /etc/inputrc file to get a functioning DEL > > ke. > >Thanks! I've been wondering about that for far too long. :-) > > >BTW I read the readline portion of "man bash" and was able to figure >out the "~/.inputrc", "\e", ":", "delete-char" parts, but how did you >figure out that the <Del> key maps to "[3~"? Searching "man bash" and >"man readline" for "[3~" and subsets didn't seem to do the trick, nor >did "apropos escape" or Google "[3~"... > > >TIA, > >David -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/