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

Strange behavior when hitting escape after hitting [cdy] #295

Open
2 of 3 tasks
Goose97 opened this issue Oct 9, 2024 · 1 comment
Open
2 of 3 tasks

Strange behavior when hitting escape after hitting [cdy] #295

Goose97 opened this issue Oct 9, 2024 · 1 comment

Comments

@Goose97
Copy link

Goose97 commented Oct 9, 2024

General information

  • Terminal program: unknown unknown (xterm-kitty)
  • Operating system: macOS 15.0 (24A335)
  • ZSH framework:
  • ZSH version: zsh 5.9 (arm64-apple-darwin24.0)
  • ZVM version: zsh-vi-mode 0.11.0 (cd730cd, 2024-07-02 18:19:13 +0800)

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

When I perform these key sequence in normal mode:

  1. Hit either c, d or y
  2. Hit Escape

Instead of exiting to normal mode, it enters visual mode.

Screen.Recording.2024-10-09.at.18.48.26.mov

Reproduction steps

  1. Make sure you are in normal mode
  2. Hit c (or d, y)
  3. Hit Escape

Expected behavior

Shell should exit to normal mode

@Goose97
Copy link
Author

Goose97 commented Oct 9, 2024

After some git bisect, I believe 11ab44d is the commit that introduced this behavior.

I've tried to tweak it a little bit. Changing these lines fixes the issue. Not sure if it's the correct way to do it.

if [[ $(zvm_escape_non_printed_characters "$keys") =~
  ${ZVM_VI_OPPEND_ESCAPE_BINDKEY/\^\[/\\^\\[} ]]; then
-  return 1
+  return 0 # return 3 works as well
fi

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

1 participant