summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2005-06-08 16:38:25 +0000
committerMark Mitchell <mark@codesourcery.com>2005-06-08 16:38:25 +0000
commitdaf8862a0f74dff18e82df21335d30ca1e5c1a98 (patch)
treef6a66ecb993d89a51f30d8984f9abd094edfe0a1
parentcb7fb0130b8e3c6550dc60c6f1fd0af855473b39 (diff)
downloadgdb-daf8862a0f74dff18e82df21335d30ca1e5c1a98.tar.gz
* 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.csl12
-rw-r--r--readline/input.c2
-rw-r--r--readline/readline.c16
-rw-r--r--readline/rlnotty.c3
4 files changed, 29 insertions, 4 deletions
diff --git a/ChangeLog.csl b/ChangeLog.csl
index 1ce142d5ca3..5cf0f2fa600 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 feef459205c..79cfa3fdf13 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 aed0235bf3f..008e87da3cf 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 f3312307f8b..4bde1c0ea07 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;
}