]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* readline/input.c (rL_getc): Use getch, not getche.
authorMark Mitchell <mark@codesourcery.com>
Wed, 8 Jun 2005 16:38:25 +0000 (16:38 +0000)
committerMark Mitchell <mark@codesourcery.com>
Wed, 8 Jun 2005 16:38:25 +0000 (16:38 +0000)
* 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
readline/input.c
readline/readline.c
readline/rlnotty.c

index 1ce142d5ca3c1f517107f06b851532a4dca97ba1..5cf0f2fa600e9447ac8ee8be0798ea48a8475d9d 100644 (file)
@@ -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>
 
index feef459205cd7c0fa6cc39fde6e62f41fb17aed3..79cfa3fdf1399250e5c8ffeaf39123731524beb4 100644 (file)
@@ -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));
 
index aed0235bf3f1dc745bc533793e497a6c03250c06..008e87da3cf683dd684bb4cbddca9cf3af228f78 100644 (file)
@@ -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);
index f3312307f8b85cd63828e8d350d1ae62707f9857..4bde1c0ea07ee0912e80e959b0115ff586a5e82c 100644 (file)
@@ -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;
 }