zsh-vi-mode icon indicating copy to clipboard operation
zsh-vi-mode copied to clipboard

Do not enter normal mode on alt + left/right/down arrow keys

Open MahdiNazemi opened this issue 6 months ago • 1 comments

General information

  • Terminal program: iTerm.app 3.5.3 (xterm-256color)
  • Operating system: macOS 14.5 (23F79)
  • ZSH framework: oh-my-zsh master (5e957cd)
  • ZSH version: zsh 5.9 (x86_64-apple-darwin23.0)
  • ZVM version: zsh-vi-mode 0.11.0

Basic examination

  • [x] I have read through the README page
  • [x] I have the latest version of zsh-vi-mode
  • [x] I have tested with another terminal program

Problem description

Pressing alt/option + one of the left/right/down arrow keys takes me to the normal mode

Expected behavior

I have not defined any ZVM custom mappings for these key combinations and did not find a mapping for them in the source code, so I do not expect them to take me to the normal mode.

There could be something wrong on my end, but I have not been able to find it yet.

Thanks for the great plugin!

Update

  • I realized after posting here that alt + many other keys exhibit the same behavior.
  • I have set iTerm to send Esc+ when I press the alt/option key.
  • I have the following mappings in my ~/.zshrc:
    • zvm_bindkey viins '^[[A' up-line-or-beginning-search
    • zvm_bindkey viins '^[[B' down-line-or-beginning-search
    • bindkey -v
    • bindkey "^R" history-incremental-search-backward
    • bindkey -M viins "^E" fzf-history-widget

More mappings:

"^[" zvm_readkeys_handler
"^[^[" sudo-command-line
"^[OA" up-line-or-beginning-search
"^[OB" down-line-or-beginning-search
"^[OC" vi-forward-char
"^[OD" vi-backward-char
"^[OF" end-of-line
"^[OH" beginning-of-line
"^[[1;5C" forward-word
"^[[1;5D" backward-word
"^[[200~" bracketed-paste
"^[[3;5~" kill-word
"^[[3~" delete-char
"^[[5~" up-line-or-history
"^[[6~" down-line-or-history
"^[[A" up-line-or-beginning-search
"^[[B" down-line-or-beginning-search
"^[[C" vi-forward-char
"^[[D" vi-backward-char
"^[[F" end-of-line
"^[[H" beginning-of-line
"^[[Z" reverse-menu-complete
"^[c" fzf-cd-widget

MahdiNazemi avatar Jul 25 '24 03:07 MahdiNazemi