jeffreytse / zsh-vi-mode

💻 A better and friendly vi(vim) mode plugin for ZSH.
MIT License
2.94k stars 102 forks source link

Compatibility with xcape? #205

Closed musjj closed 1 year ago

musjj commented 1 year ago

General information

Basic examination

Problem description

I've remapped my capslock key to behave as both a control key and an escape key, but it caused zvm to misbehave in a weird way.

Pressing the capslock key will cause the cursor to transform into a block for a brief moment, before turning into an underscore. Pressing the button again will emit this error: No such widget '^[^[^['.

Still not really familiar with zsh in general, so I have no idea what is causing this.

Reproduction steps

setxkbmap -option ctrl:nocaps
xcape -e "Control_L=Escape"

Then press the (physical) capslock key.

Expected behavior

zvm enters normal mode.

musjj commented 1 year ago

Hmm, it looks like that xcape is sending the escape key twice after releasing the capslock key. Not sure why this is happening.

musjj commented 1 year ago

Never mind, I think I've accidentally ran the xcape command twice due to sourcing some file, which is why it was sending double escapes.