From patchwork Sun Aug 8 17:11:00 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nir Tzachar X-Patchwork-Id: 118283 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 o78HArOM008044 for ; Sun, 8 Aug 2010 17:10:53 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751786Ab0HHRKw (ORCPT ); Sun, 8 Aug 2010 13:10:52 -0400 Received: from mail-bw0-f46.google.com ([209.85.214.46]:64232 "EHLO mail-bw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750712Ab0HHRKv (ORCPT ); Sun, 8 Aug 2010 13:10:51 -0400 Received: by bwz3 with SMTP id 3so774296bwz.19 for ; Sun, 08 Aug 2010 10:10:50 -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=mMh8zk0TL24LnuwpnA8eSEzOgaE6bJkkVIVkCyh50hM=; b=D1dovJUI/d2XOciNm5Ic5p+RbPNr/fOXXJWElcsG2GhjT2lKO7/fOD1N1hl17mTRxE 172oUYcfQXHsyYMOt0Hm8BXvV63xFZyWPDdVyZGU1w83iBCCDNfe0Yi+CAh3B/yxr68m hz7ps8dqma0lgas3AmpeZNaFMCGZLPlpaQPaY= 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=DOagB3uLkrCnztnjnh6j9v6qbK0RPtKnMC8m+9wXOraQWH6dtDIcD70TGNoYfA9Nr3 NgCKe5mHbdT1WbNxCf4VRS9IjpH2Gqrq28kCp1jgzVjvyGc5+5iDjTch2NfcVf20tKjH nlzbNQY/S6T3ts7LvsRu/Tk4MjbMhXGpBXOGs= Received: by 10.204.47.214 with SMTP id o22mr9746752bkf.17.1281287450532; Sun, 08 Aug 2010 10:10:50 -0700 (PDT) Received: from localhost (bzq-84-108-131-249.cablep.bezeqint.net [84.108.131.249]) by mx.google.com with ESMTPS id bq20sm2497518bkb.4.2010.08.08.10.10.49 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 08 Aug 2010 10:10:50 -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: resend [PATCH] nconfig: properly map function keys. Date: Sun, 8 Aug 2010 20:11:00 +0300 Message-Id: <1281287460-32332-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:10:53 +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;