From: nir.tzachar@gmail.com
To: sam@ravnborg.org, mmarek@suse.cz
Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
nir.tzachar@gmail.com
Subject: [PATCH] nconfig: properly map function keys.
Date: Sun, 8 Aug 2010 20:08:39 +0300 [thread overview]
Message-ID: <1281287319-32281-1-git-send-email-nir.tzachar@gmail.com> (raw)
In-Reply-To: <20100808154233.GB4205@merkur.ravnborg.org>
From: Nir Tzachar <nir.tzachar@gmail.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@gmail.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
next parent reply other threads:[~2010-08-08 17:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20100808154233.GB4205@merkur.ravnborg.org>
2010-08-08 17:08 ` nir.tzachar [this message]
2010-08-08 17:11 ` resend [PATCH] nconfig: properly map function keys nir.tzachar
2010-08-08 18:58 ` Sam Ravnborg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1281287319-32281-1-git-send-email-nir.tzachar@gmail.com \
--to=nir.tzachar@gmail.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mmarek@suse.cz \
--cc=sam@ravnborg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).