From 19025b41d133c558f862e9d574138a7ddb165b7e Mon Sep 17 00:00:00 2001 From: Mark Mitchell Date: Wed, 8 Jun 2005 16:38:25 +0000 Subject: * 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. --- ChangeLog.csl | 12 ++++++++++-- readline/input.c | 2 +- readline/readline.c | 16 ++++++++++++++++ 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 + + * 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 - * 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 - * opncls.c (bfd_fdopenr): Add missing break statements. + * bfd/opncls.c (bfd_fdopenr): Add missing break statements. 2005-06-07 Mark Mitchell 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; } -- cgit v1.1