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


Christopher Faylor wrote:
>>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 fhandler_console.cc. ÂIt already uses ReadConsoleInput(), so
>>mapping from VK_BACK to ^? Âmight be fairly straightforward actually.
>
> And a patch would have been appreciated...

Sorry, I didn't think I understood the code enough for that.


> However, I have made the change to Cygwin to translate backspace to ^?.
> It will be in the next snapshot.

Great, thanks! Does this apply both with and without CYGWIN=tty? And I
guess native console applications won't be affected by this?

The relevant termios default setting will need to change accordingly,
either by changing the definition of CERASE in include/sys/termios.h:

-#define CERASE	CTRL('H')
+#define CERASE	CDEL

Or by changing the initialisation in fhandler_termios.c:

-      tc->ti.c_cc[VERASE]	= CERASE;
+      tc->ti.c_cc[VERASE]	= CDEL;

The cygwin section in /etc/termcap doesn't have a kb entry, so luckily
no change needed there.

terminfo has an entry for backspace though:

$ tput -T cygwin kbs | cat -v
^H

So this has to to change as well:

+++ terminfo.src        2009-05-30 07:50:44.893933600 +0100
@@ -5221,7 +5221,7 @@
-       kbs=^H, kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A,
+       kbs=^?, kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A,

And then there are rxvt and xterm and their termcap and terminfo
entries as well ...

One more thing: with your change, Alt can be used to override ^? and
get ^H instead. Usually though, Ctrl is used as the modifier for this,
whereas Alt acts as Meta (i.e. it sends a ^[ prefix).

Andy

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


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