This is the mail archive of the
mailing list for the Cygwin project.
Re: Map Backspace to ASCII DEL?
- From: "Dr.D.J.Picton" <dave at aps5 dot ph dot bham dot ac dot uk>
- To: cygwin at cygwin dot com
- Date: Thu, 21 Aug 2003 11:43:35 +0100 (BST)
- Subject: Re: Map Backspace to ASCII DEL?
- Reply-to: "Dr.D.J.Picton" <dave at aps5 dot ph dot bham dot ac dot uk>
> From: Elfyn McBratney <elfyn at cygwin dot com>
> To: cygwin at cygwin dot com
> Date: Thu, 21 Aug 2003 06:01:54 +0100
> Subject: Re: Map Backspace to ASCII DEL?
> References: <3F444AC6.firstname.lastname@example.org>
> Reply-to: cygwin at cygwin dot com
> Ian Brandt <email@example.com> wrote:
> > I've searched through the mailing list and have seen many posts related
> > to backspace and delete behavior, so my apologies in advance for yet
> > another one, but I can't seem to find the answer I'm looking for in the
> > archives.
> > Currently it seems that the cygwin terminal sends ^H (ASCII BS, 0x08)
> > for backspace, and the VT220 Remove escape sequence (\E[3~, 0x1B5B337E)
> > for Delete. I'd like it to send ^? (ASCII DEL, 0x7F) so that ^H can be
> > used by applications (e.g. emacs). This is how I've always configured
> > other terminal emulators that I've used, and it has worked well.
> > I believe Cygwin just repeats what it gets from Windows. Typically for
> > the console this would changed via keymaps, but I don't see that Cygwin
> > uses this. I don't want to change my mapping in Windows as obviously
> > that would mess up my native environment. Is there a low level way to
> > change the keymap for Cygwin? If not is there a source hack I could
> > implement (and if so where in the source should I look)?
> `stty erase ^?', IIRC.
No! Stty settings don't change keyboard mappings. All the 'stty erase'
setting does is to select the 'character delete' code for use in 'simple'
terminal input (e.g. from applications like ftp as opposed to shells which
handle line editing themselves). Setting stty erase ^? achieves nothing
useful with the default key mappings, because you can't actually generate
a delete character!
I think that rxvt has the functionality which you require. For example:
rxvt -backspacekey ^? -deletekey ^h
will give you a session in which the backspace key generates ^h and the
delete key generates ^?. (It might then be useful to issue stty -erase ^?
so that you can use the backspace key to delete characters in simple
In the case of emacs, have you tried running it under X11? In this mode it
can distinguish between the backspace key (which it interprets as a
'delete last character' function) and ^h (which calls the help command).
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html