From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3345 invoked by alias); 12 Jun 2005 07:33:08 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 3310 invoked by uid 22791); 12 Jun 2005 07:33:02 -0000 Received: from sibelius.xs4all.nl (HELO sibelius.xs4all.nl) (82.92.89.47) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Sun, 12 Jun 2005 07:33:02 +0000 Received: from elgar.sibelius.xs4all.nl (root@elgar.sibelius.xs4all.nl [192.168.0.2]) by sibelius.xs4all.nl (8.13.0/8.13.0) with ESMTP id j5C7VVwY022426; Sun, 12 Jun 2005 09:31:31 +0200 (CEST) Received: from elgar.sibelius.xs4all.nl (kettenis@localhost.sibelius.xs4all.nl [127.0.0.1]) by elgar.sibelius.xs4all.nl (8.13.4/8.13.3) with ESMTP id j5C7VU3m012461; Sun, 12 Jun 2005 09:31:30 +0200 (CEST) Received: (from kettenis@localhost) by elgar.sibelius.xs4all.nl (8.13.4/8.13.4/Submit) id j5C7VMNO030966; Sun, 12 Jun 2005 09:31:22 +0200 (CEST) Date: Sun, 12 Jun 2005 07:33:00 -0000 Message-Id: <200506120731.j5C7VMNO030966@elgar.sibelius.xs4all.nl> From: Mark Kettenis To: mark@codesourcery.com CC: gdb-patches@sources.redhat.com, bug-readline@gnu.org In-reply-to: <200506081742.j58Hg6O0017392@sethra.codesourcery.com> (message from Mark Mitchell on Wed, 8 Jun 2005 10:42:06 -0700) Subject: Re: PATCH: Readline for MinGW References: <200506081742.j58Hg6O0017392@sethra.codesourcery.com> X-SW-Source: 2005-06/txt/msg00117.txt.bz2 Date: Wed, 8 Jun 2005 10:42:06 -0700 From: Mark Mitchell The problems solved by this patch are: 1. Windows does not have termcap/curses/etc. So, we provide a stub files that contains basic implementations of the relevant functions. That permits the remainder of the code to continue using the POSIX interfaces unchanged. 2. The arrow keys use different extended key sequences on Windows than on POSIX systems; we introduce readline macros to transform the Windows sequences into their POSIX equivalents. This approach again confines the Windows-isms to a single point. Huh? AFAIK, POSIX doesn't say anything about arrow keys or the sequences produced by it. That's all determined by the terminal type. Hmm, it looks like that readline simply hardcodes the ANSI sequences for these keys instead of consulting termcap. Not your fault though. But if it did consult termcap, you could provide a stub tgetent() that did the mapping. Incidentally, I find the way you find you write the macros a bit confusing: + #ifdef __MINGW32__ + /* Under Windows, when an extend key (like an arrow key) is + pressed, getch() will return 0xE0 followed by a code for the + extended key. We use macros to transform those into the normal + UNIX sequences for these keys. */ + + /* Up arrow. */ + rl_macro_bind ("\340H", "\033[A", map); + /* Left arrow. */ + rl_macro_bind ("\340K", "\033[D", map); + /* Right arrow. */ + rl_macro_bind ("\340M", "\033[C", map); + /* Down arrow. */ + rl_macro_bind ("\340P", "\033[B", map); + #endif It has "\34" and "\033" on the same line so I get confused whether "\34" is octal or not... Also, I don't see any trace of the 0xE0 you mention in the comment. Mark