This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: PATCH: Readline for MinGW
> Date: Sun, 12 Jun 2005 09:31:22 +0200 (CEST)
> From: Mark Kettenis <mark.kettenis@xs4all.nl>
> CC: gdb-patches@sources.redhat.com, bug-readline@gnu.org
>
> 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.
Yes, "ANSI" would be a better term here.
> + #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...
That's not "\34", that's "\340". Which I guess explains the other
confusion:
> Also, I don't see any trace of the 0xE0 you mention in the comment.
340 in octal is E0 in hex. I.e., the up arrow, for example, produces
two characters: 0xE0 followed by H.