Clarify ANSI, not POSIX, terminal escapes in ChangeLog
[deliverable/binutils-gdb.git] / readline / readline.c
index 28801f19dfc1ea1036258440ee690a1b1438ffd7..07fb58fd210d2f973c0bcbc1cf9f6e11af8d5bf9 100644 (file)
@@ -684,6 +684,7 @@ _rl_dispatch_subseq (key, map, got_subseq)
     }
 #if defined (VI_MODE)
   if (rl_editing_mode == vi_mode && _rl_keymap == vi_movement_keymap &&
+      key != ANYOTHERKEY &&
       _rl_vi_textmod_command (key))
     _rl_vi_set_last (key, rl_numeric_arg, rl_arg_sign);
 #endif
@@ -867,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 340 (octal) followed by a code for
+      the extended key.  We use macros to transform those into the
+      normal ANSI terminal 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);
@@ -933,7 +950,9 @@ rl_save_state (sp)
   sp->macro = rl_executing_macro;
 
   sp->catchsigs = rl_catch_signals;
+#if defined (SIGWINCH)
   sp->catchsigwinch = rl_catch_sigwinch;
+#endif
 
   return (0);
 }
@@ -967,7 +986,9 @@ rl_restore_state (sp)
   rl_executing_macro = sp->macro;
 
   rl_catch_signals = sp->catchsigs;
+#if defined (SIGWINCH)
   rl_catch_sigwinch = sp->catchsigwinch;
+#endif
 
   return (0);
 }
This page took 0.024973 seconds and 4 git commands to generate.