lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Sun,  8 Aug 2010 20:08:39 +0300
From:	nir.tzachar@...il.com
To:	sam@...nborg.org, mmarek@...e.cz
Cc:	linux-kbuild@...r.kernel.org, linux-kernel@...r.kernel.org,
	nir.tzachar@...il.com
Subject: [PATCH] nconfig: properly map function keys.

From: Nir Tzachar <nir.tzachar@...il.com>

Hi Sam. Please try the following patch and see if it helps.


Subject: [PATCH] nconfig: properly map function keys.
When $TERM=xterm,xterm-color,vt220 map function keys properly.

Signed-off-by: Nir Tzachar <nir.tzachar@...il.com>
---
 scripts/kconfig/nconf.c |   23 ++++++++++++++++++++---
 1 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/scripts/kconfig/nconf.c b/scripts/kconfig/nconf.c
index c6feb41..a641a66 100644
--- a/scripts/kconfig/nconf.c
+++ b/scripts/kconfig/nconf.c
@@ -1537,13 +1537,13 @@ int main(int ac, char **av)
 
 	/* Initialize curses */
 	initscr();
-	/* set color theme */
-	set_colors();
-
 	cbreak();
 	noecho();
 	keypad(stdscr, TRUE);
 	curs_set(0);
+	/* set color theme */
+	set_colors();
+
 
 	if (COLS < 75 || LINES < 20) {
 		endwin();
@@ -1552,6 +1552,23 @@ int main(int ac, char **av)
 		return 1;
 	}
 
+	const char *term = getenv("TERM");
+	if (strcmp(term, "xterm") == 0 ||
+	    strcmp(term, "xterm-color") == 0 ||
+	    strcmp(term, "vt220") == 0) {
+		define_key("\033[H", KEY_HOME);
+		define_key("\033[F", KEY_END);
+		define_key("\033OP", KEY_F(1));
+		define_key("\033OQ", KEY_F(2));
+		define_key("\033OR", KEY_F(3));
+		define_key("\033OS", KEY_F(4));
+		define_key("\033[16~", KEY_F(5));
+		define_key("\033[17~", KEY_F(6));
+		define_key("\033[18", KEY_F(7));
+		define_key("\033[19~", KEY_F(8));
+		define_key("\033[20~", KEY_F(9));
+	}
+
 	notimeout(stdscr, FALSE);
 	ESCDELAY = 1;
 
-- 
1.6.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ