This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: emacs -nw keypad, tpu-edt.el, and C-h

>>> Actually, this holy war can be bypassed, without sacrificing Emacs
>>> correctly working on a console. ÂWhat the console should send for that
>>> is the <Backspace> function key.
>> Makes sense to me. ÂAndy, is there any reason all cygwin terminals shouldn't
>> do this (including mintty)? ÂThis already happens under X, and users would
>> then have consistent behavior.
> What is the "<Backspace> function key", i.e. what character sequence
> does that correspond to?

I've had a look at the emacs source. The Windows console variant of
emacs uses low-level console I/O, namely the ReadConsoleInput()
function. This delivers a stream of so-called input events, rather
than a stream of characters like the high-level console functions.
Also see here for the distinction:

One type of input event is a key event, which tells you exactly what
key was pressed and which modifiers are down. Emacs translates that
directly into its internal keyboard representation such as
<Backspace>, thereby indeed bypassing the whole question of how keys
should be represented in a character stream.

Unix terminals are character devices though, sp terminal emulators
have to encode keyboard events as sequences of characters, as that's
what terminal applications expect to get. The terminal version of
emacs then translates those into its internal representation.

Now of course if emacs can translate low-level console I/O as it sees
fit, then the Cygwin DLL could also be able to translate Backspace
into ^? characters rather than ^H, in CYGWIN=tty mode anyway. So I had
a look at It already uses ReadConsoleInput(), so
mapping from VK_BACK to ^? might be fairly straightforward actually.

I guess Cygwin 1.7 will be the last chance for quite a while to make
such a change, so is this something that should be considered?  A bit
of googling tells me that Redhat Linux actually decided to follow the
Debian guidelines many years ago and used ^? ever since, apart from a
little wobble in Fedora Core 3.


Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]