From: Mark Kettenis <mark.kettenis@xs4all.nl>
To: mark@codesourcery.com
Cc: gdb-patches@sources.redhat.com, bug-readline@gnu.org
Subject: Re: PATCH: Readline for MinGW
Date: Sun, 12 Jun 2005 07:33:00 -0000 [thread overview]
Message-ID: <200506120731.j5C7VMNO030966@elgar.sibelius.xs4all.nl> (raw)
In-Reply-To: <200506081742.j58Hg6O0017392@sethra.codesourcery.com> (message from Mark Mitchell on Wed, 8 Jun 2005 10:42:06 -0700)
Date: Wed, 8 Jun 2005 10:42:06 -0700
From: Mark Mitchell <mark@codesourcery.com>
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
next prev parent reply other threads:[~2005-06-12 7:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-08 17:43 Mark Mitchell
2005-06-12 7:33 ` Mark Kettenis [this message]
2005-06-12 8:43 ` Eli Zaretskii
2005-06-12 9:27 ` Mark Kettenis
2005-06-13 6:09 ` Mark Mitchell
2005-06-15 18:14 ` James Lemke
2005-06-22 1:22 ` Chet Ramey
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=200506120731.j5C7VMNO030966@elgar.sibelius.xs4all.nl \
--to=mark.kettenis@xs4all.nl \
--cc=bug-readline@gnu.org \
--cc=gdb-patches@sources.redhat.com \
--cc=mark@codesourcery.com \
/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