[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[MiNT] [PATCH] Remove IEXTEN to XKEY mapping (fixes nano arrow keys)
- To: mint@lists.fishpool.fi
- Subject: [MiNT] [PATCH] Remove IEXTEN to XKEY mapping (fixes nano arrow keys)
- From: Vincent Rivière <vincent.riviere@freesbee.fr>
- Date: Mon, 06 Oct 2014 01:30:04 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type; bh=izC4MO4x58+wIiW8Ynh7QT/AlkAJkxMk7PTVJJTSehs=; b=NP6c1W91kXK3R+KJqoTcn3Py36g6WCYdWLBwCT9lY1bZJcgVlqF+3FlJaqbAJ2dTB6 nZbpgiwmebyvz3ZWyr1F4z+owIIpJzu8u43CzP4G3xz97/Xv0A4FZFPDkp+o5pSaVgYA 0Y5C6oH/265lxWpSUN+t0JnyExGnmqBbeVndVxHSR3NX2fm70MaB46b+qG4igKd45Ehf 37UeAxw1QM3AUwjdfYil6zA6XDogln4qlQiofiXse8RsGABQof3C7Z7rgXkLcJ2MRgFQ BSYRqhTrq0gCpSNWz3AyW+uNl7Orhk5e8iylM/MwSjc417frV6mCsV9GsZUu5RgKGZcB lw3Q==
- In-reply-to: <m2txpkauq6.fsf@igel.home>
- List-help: <mailto:ecartis@lists.fishpool.fi?Subject=help>
- List-id: <mint.lists.fishpool.fi>
- List-owner: <mailto:tjhukkan@fishpool.fi>
- List-post: <mailto:mint@lists.fishpool.fi>
- List-subscribe: <mailto:mint-request@lists.fishpool.fi?Subject=subscribe>
- List-unsubscribe: <mailto:mint-request@lists.fishpool.fi?Subject=unsubscribe>
- References: <51166E1C.2080807@freesbee.fr> <op.wr8w3c1cofd6j1@nebbiolo> <51167BD9.1040202@freesbee.fr> <m2fw1576sf.fsf@igel.home> <5117E0AB.9030200@freesbee.fr> <m2txpkauq6.fsf@igel.home>
- Sender: mint-bounce@lists.fishpool.fi
- User-agent: Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Thunderbird/31.1.2
On 10/02/2013 19:29, Andreas Schwab wrote:
Do you believe that mapping IEXTEN to XKEY is correct?
I don't think so. The main function of IEXTEN is to enable extra
characters that perform local tty control functions (see the example of
enabling backslash to quote the next character). As such it should only
change how characters are intercepted at the tty level, but should not
alter the characters that are sent through to the read queue.
For memories:
- XKEY is a kernel flag which generates escape sequences when function keys
(such arrows) are pressed.
- IEXTEN is a termios flag to change the interpretation of some special
characters.
We agreed that the MiNTLib mapping from IEXTEN to XKEY was incorrect.
Here is a patch which disables that mapping. This fixes the arrow keys with
nano on the BIOS console.
IEXTEN.patch
Remove IEXTEN to XKEY mapping. Contributed by Vincent Riviere.
Alan, please commit!
NB: If software needs to disable the XKEY feature, they must use
Fcntl(TIOCSETN), just like XaAES does.
--
Vincent Rivière
diff -aurN -x CVS mintlib.orig/termios/tcgetattr.c mintlib/termios/tcgetattr.c
--- mintlib.orig/termios/tcgetattr.c 2013-12-19 11:27:13.234375000 +0100
+++ mintlib/termios/tcgetattr.c 2014-10-06 00:52:47.093750000 +0200
@@ -71,7 +71,6 @@
| ((sg.sg_flags & ODDP) ? (PARENB | PARODD) : 0));
stp->c_lflag = (tcflag_t) ((sg.sg_flags & (TOSTOP | NOFLSH | ECHOCTL))
| ((sg.sg_flags & ECHO) ? (ECHO | ECHOE | ECHOK) : 0)
- | ((sg.sg_flags & XKEY) ? IEXTEN : 0)
| ((sg.sg_flags & RAW)
? 0
: ISIG | (sg.sg_flags & CBREAK ? 0 : ICANON)));
diff -aurN -x CVS mintlib.orig/termios/tcsetattr.c mintlib/termios/tcsetattr.c
--- mintlib.orig/termios/tcsetattr.c 2002-04-24 08:54:11.000000000 +0200
+++ mintlib/termios/tcsetattr.c 2014-10-06 00:52:47.093750000 +0200
@@ -42,7 +42,7 @@
return -1;
}
sg.sg_flags &= ~(CRMOD | TANDEM | RTSCTS | EVENP | ODDP | TOSTOP
- | NOFLSH | ECHOCTL | RAW | CBREAK | ECHO | XKEY);
+ | NOFLSH | ECHOCTL | RAW | CBREAK | ECHO);
sg.sg_flags |= (((stp->c_iflag & ICRNL) ? CRMOD : 0)
| (((stp->c_iflag & (IXON | IXOFF)) == (IXON | IXOFF)) ? TANDEM : 0)
| ((stp->c_cflag & CRTSCTS) ? RTSCTS : 0));
@@ -55,7 +55,6 @@
? ((stp->c_cflag & PARODD) ? ODDP : EVENP)
: 0);
sg.sg_flags |= ((stp->c_lflag & (TOSTOP | NOFLSH | ECHOCTL | ECHO))
- | ((stp->c_lflag & IEXTEN) ? XKEY : 0)
| ((stp->c_lflag & ISIG)
? (stp->c_lflag & ICANON ? 0 : CBREAK) : RAW));
sg.sg_ispeed = (char) stp->_c_ispeed;