Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 3630

Summary: x11-terms/aterm patch for home&end keys to work properly under mutt/vim/...
Product: Gentoo Linux Reporter: Karsten <quixus>
Component: Current packagesAssignee: Seemant Kulleen (RETIRED) <seemant>
Status: RESOLVED FIXED    
Severity: normal    
Priority: Normal    
Version: 1.2   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Karsten 2002-06-11 10:51:41 UTC
Hi, here's a patch I'd like to suggest to be included for the x11-term aterm.
The patch comments the line "#define LINUX_KEYS" in src/feature.h out and
thereby fixes aterm's strange home&end keys behaviour under vim/mutt/... Here's
what Mikko.Hanninen@dna.fi wrote about it:

Mutt uses getch() from curses.  I found out, after a bit of hacking and
adding debugging info, that this function was returning KP_FIND and
KP_SELECT, for Home and End respectively.  The Find and Select keys were
undefined in Mutt's keymap (and as they should be -- my keyboard doesn't
have them!), so Mutt properly returned "invalid key".

So, why was getch() returning KP_FIND and KP_SELECT, instead of KP_HOME
and KP_END?  I started digging around in the aterm sources, and sure
enough, I found something called LINUX_KEYS defined in aterm's
feature.h, which makes the Home and End keys return the strings \e[1~
and \e[2~ -- which are apparently used for the Find and Select keys on
some other platforms.  By undefining LINUX_KEYS I now get \e[7~ and
\e[8~, which I can bind in Mutt.

This doesn't seem to be fixable by editing /etc/inputrc.

Patch:

--- src/feature.h-old   2001-09-06 18:38:07.000000000 +0200
+++ src/feature.h       2002-06-11 17:30:30.000000000 +0200
@@ -123,7 +123,7 @@
  * instead of
  *     Home = "\E[7~", End = "\E[8~"   [default]
  */
-#define LINUX_KEYS
+/* #define LINUX_KEYS */

 /*
  * Enable the keysym resource which allows you to define strings associated
Comment 1 Seemant Kulleen (RETIRED) gentoo-dev 2002-06-11 11:50:07 UTC
thanks for the fix :)

-r3 of aterm contains it