Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
3 tasks done
MahdiNazemi opened this issue Jul 25, 2024 · 1 comment
Open
3 tasks done

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

MahdiNazemi opened this issue Jul 25, 2024 · 1 comment

Comments

@MahdiNazemi
Copy link

MahdiNazemi commented Jul 25, 2024

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

  • I have read through the README page
  • I have the latest version of zsh-vi-mode
  • 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
@hrideshmg
Copy link

hrideshmg commented Jul 29, 2024

Facing the same issue on alt+enter, the escape sequence maps to ^[^M on my terminal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants