diff options
| author | Chet Ramey <chet.ramey@case.edu> | 2011-12-03 13:53:16 -0500 |
|---|---|---|
| committer | Chet Ramey <chet.ramey@case.edu> | 2011-12-03 13:53:16 -0500 |
| commit | ac58e8c8a12e809c6d8d299d245267bcab28a8fb (patch) | |
| tree | dcf6916ec6937720f64b38d01874522ee28e680a /lib/readline/rltty.c | |
| parent | 6bf74e5acaff9494bde49b6e05cbb57f7c255f19 (diff) | |
| download | bash-ac58e8c8a12e809c6d8d299d245267bcab28a8fb.tar.gz | |
commit bash-20051110 snapshot
Diffstat (limited to 'lib/readline/rltty.c')
| -rw-r--r-- | lib/readline/rltty.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/lib/readline/rltty.c b/lib/readline/rltty.c index e618594f..9a0326ed 100644 --- a/lib/readline/rltty.c +++ b/lib/readline/rltty.c @@ -683,11 +683,29 @@ rl_prep_terminal (meta_flag) otio = tio; if (_rl_bind_stty_chars) - rl_tty_unset_default_bindings (_rl_keymap); + { +#if defined (VI_MODE) + /* If editing in vi mode, make sure we restore the bindings in the + insertion keymap no matter what keymap we ended up in. */ + if (rl_editing_mode == vi_mode) + rl_tty_unset_default_bindings (vi_insertion_keymap); + else +#endif + rl_tty_unset_default_bindings (_rl_keymap); + } save_tty_chars (&otio); RL_SETSTATE(RL_STATE_TTYCSAVED); if (_rl_bind_stty_chars) - _rl_bind_tty_special_chars (_rl_keymap, tio); + { +#if defined (VI_MODE) + /* If editing in vi mode, make sure we set the bindings in the + insertion keymap no matter what keymap we ended up in. */ + if (rl_editing_mode == vi_mode) + _rl_bind_tty_special_chars (vi_insertion_keymap, tio); + else +#endif + _rl_bind_tty_special_chars (_rl_keymap, tio); + } prepare_terminal_settings (meta_flag, otio, &tio); |
