From patchwork Sun Aug 8 17:08:39 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nir Tzachar X-Patchwork-Id: 118281 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o78H8qDs007754 for ; Sun, 8 Aug 2010 17:08:52 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751671Ab0HHRIw (ORCPT ); Sun, 8 Aug 2010 13:08:52 -0400 Received: from mail-bw0-f46.google.com ([209.85.214.46]:54331 "EHLO mail-bw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750712Ab0HHRIv (ORCPT ); Sun, 8 Aug 2010 13:08:51 -0400 Received: by bwz3 with SMTP id 3so773852bwz.19 for ; Sun, 08 Aug 2010 10:08:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer:in-reply-to:references; bh=q8/5/y2dpYmGFsmgWdRSDo2kgpm9v6ZX6E3m23ayHvE=; b=BulenWVd5bjyMOdtqoYTDMlUnDQwhYWfm755O5UXE0DmnG5dcFQL/UBJDSz4Z3cLc7 bKcw6bdhvt8pD2FunGZI0MZc1v4xX4KtYTtTA0iJw+MM1AUo7h6niA0t6ARocUjmgJVi nnOqb/UawsFebi61neZhZ/OtG9ontcBPkRYks= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=hyEvHCvoK7c4wUTgwYcJydKgfet/PUb8HitiNb3z9Gako0lrLKKK/zIeiGDw3M6Z9V F+xH6Z9Q/xrTK0HklwuRrxmo7le9f/pHmpO7ZONWfMAAD3y7yoNLHqOVEpQpTmcv7mnT lH3bVySuWHimIDL3joZg0bMsNAe3oPSeKYIwc= Received: by 10.204.57.146 with SMTP id c18mr1717312bkh.205.1281287329650; Sun, 08 Aug 2010 10:08:49 -0700 (PDT) Received: from localhost (bzq-84-108-131-249.cablep.bezeqint.net [84.108.131.249]) by mx.google.com with ESMTPS id f18sm1630373bkf.3.2010.08.08.10.08.48 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 08 Aug 2010 10:08:49 -0700 (PDT) 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 Message-Id: <1281287319-32281-1-git-send-email-nir.tzachar@gmail.com> X-Mailer: git-send-email 1.6.4.4 In-Reply-To: <20100808154233.GB4205@merkur.ravnborg.org> References: <20100808154233.GB4205@merkur.ravnborg.org> Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Sun, 08 Aug 2010 17:08:52 +0000 (UTC) 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;