diff options
author | Mark Mitchell <mark@codesourcery.com> | 2005-06-08 16:38:25 +0000 |
---|---|---|
committer | Mark Mitchell <mark@codesourcery.com> | 2005-06-08 16:38:25 +0000 |
commit | 19025b41d133c558f862e9d574138a7ddb165b7e (patch) | |
tree | 6ac2719f49be807f33452c53a133b076ac33e85e | |
parent | 3611ddb1a84a55ff3e39e2e8c67f8bf6d017c022 (diff) | |
download | gdb-19025b41d133c558f862e9d574138a7ddb165b7e.zip gdb-19025b41d133c558f862e9d574138a7ddb165b7e.tar.gz gdb-19025b41d133c558f862e9d574138a7ddb165b7e.tar.bz2 |
* readline/input.c (rL_getc): Use getch, not getche.
* readline/readline.c (bind_arrow_keys_internal): Translate
Windows keysequences into POSIX key sequences.
* readline/rlnotty.c (tputs): Fix thinko.
(rl_prep_terminal): Set readline_echoing_p.
-rw-r--r-- | ChangeLog.csl | 12 | ||||
-rw-r--r-- | readline/input.c | 2 | ||||
-rw-r--r-- | readline/readline.c | 16 | ||||
-rw-r--r-- | readline/rlnotty.c | 3 |
4 files changed, 29 insertions, 4 deletions
diff --git a/ChangeLog.csl b/ChangeLog.csl index 1ce142d..5cf0f2f 100644 --- a/ChangeLog.csl +++ b/ChangeLog.csl @@ -1,10 +1,18 @@ +2005-06-08 Mark Mitchell <mark@codesourcery.com> + + * readline/input.c (rL_getc): Use getch, not getche. + * readline/readline.c (bind_arrow_keys_internal): Translate + Windows keysequences into POSIX key sequences. + * readline/rlnotty.c (tputs): Fix thinko. + (rl_prep_terminal): Set readline_echoing_p. + 2005-06-08 Alan Modra <amodra@bigpond.net.au> - * opncls.c (bfd_fopen): Don't set bfd_error unconditionally. + * bfd/opncls.c (bfd_fopen): Don't set bfd_error unconditionally. 2005-06-07 Mark Mitchell <mark@codesourcery.com> - * opncls.c (bfd_fdopenr): Add missing break statements. + * bfd/opncls.c (bfd_fdopenr): Add missing break statements. 2005-06-07 Mark Mitchell <mark@codesourcery.com> diff --git a/readline/input.c b/readline/input.c index feef459..79cfa3f 100644 --- a/readline/input.c +++ b/readline/input.c @@ -429,7 +429,7 @@ rl_getc (stream) from the console. (Otherwise, no characters are available until the user hits the return key.) */ if (isatty (fileno (stream))) - return getche (); + return getch (); #endif result = read (fileno (stream), &c, sizeof (unsigned char)); diff --git a/readline/readline.c b/readline/readline.c index aed0235..008e87d 100644 --- a/readline/readline.c +++ b/readline/readline.c @@ -868,6 +868,22 @@ bind_arrow_keys_internal (map) _rl_bind_if_unbound ("\033[0D", rl_get_next_history); #endif +#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 + _rl_bind_if_unbound ("\033[A", rl_get_previous_history); _rl_bind_if_unbound ("\033[B", rl_get_next_history); _rl_bind_if_unbound ("\033[C", rl_forward_char); diff --git a/readline/rlnotty.c b/readline/rlnotty.c index f331230..4bde1c0 100644 --- a/readline/rlnotty.c +++ b/readline/rlnotty.c @@ -48,7 +48,7 @@ tputs (string, nlines, outfun) int (*outfun) (); { while (*string) - outfun (*string); + outfun (*string++); } int @@ -67,6 +67,7 @@ void rl_prep_terminal (meta_flag) int meta_flag; { + readline_echoing_p = 1; return; } |