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

Pressing CTRL-[ doesn't always leave insert mode. #570

Open
TheBB opened this issue Aug 26, 2015 · 4 comments
Open

Pressing CTRL-[ doesn't always leave insert mode. #570

TheBB opened this issue Aug 26, 2015 · 4 comments

Comments

@TheBB
Copy link
Member

TheBB commented Aug 26, 2015

Originally reported by: Adam Olsen (Bitbucket: synic, GitHub: synic)


Using evil-20150818.1313 with spacemacs develop.

I have a video here. Sorry the video is so large. I was going to crop it down to the size of the editor, but screenflow won't let me do that and keep the keystrokes.

https://www.youtube.com/watch?v=WB42kaCP3x0

Basically, every once in a while, when I'm typing quickly, CTRL-[ won't actually escape, but will act as though it's starting a key combination.

I am fine to change my ESC binding to something else (other than ESC itself) if something is known to work better.


@TheBB
Copy link
Member Author

TheBB commented Aug 27, 2015

Original comment by Adam Olsen (Bitbucket: synic, GitHub: synic):


Sorry, I should say I'm using Emacs 24.5.1, on OS X with spacemacs develop.

@TheBB
Copy link
Member Author

TheBB commented Aug 28, 2015

Original comment by Frank Fischer (Bitbucket: lyro, GitHub: lyro):


The escape combination C-[ is always difficult. But you have to provide an exact recipe to reproduce the problem (i.e. starting with make emacs in Evil's source directory and an sequence of keystrokes that demonstrates the problem), otherwise I can't help.

Besides, I did never understand why anyone uses a strange keybinding like C-[ for leaving insert or visual state. You could use any keybinding you want (just have look for [escape] bindings in evil-maps.el).

@TheBB
Copy link
Member Author

TheBB commented Sep 1, 2015

Original comment by Adam Olsen (Bitbucket: synic, GitHub: synic):


I used C-[ for about 9 years because it's easier to get to than ESC, and is always going to work no matter who's config I'm using.

If I can come up with a sequence that causes this to happen, I will post here.

Thanks!

@TheBB
Copy link
Member Author

TheBB commented Sep 6, 2015

Original comment by Frank Fischer (Bitbucket: lyro, GitHub: lyro):


The problem with C-[ is that this combinations sends a different signal than the 'escape' key. The latter sends (at least in X) a special event called escape, which Emacs usually translates the ESC (or C-[), but which is caught by Evil to exit normal state. The former always sends the literal ESC, which happens to be the first of two characters uses to encode meta-combinations like M-x. The problem is that if Evil receives the first event M-, there is no way to find out whether a second event x is about to be received. Evil uses a certain timeout it waits. However, this is quite complicated and if something goes wrong with the event queue or the timeout or whatever, C-[ might not be recognized correctly (or the following event might be interpreted as part of M-something).

One way could be to remap C-[ on OS level to the same event as the escape-key, so the whole timeout stuff is not triggered at all. But I do not know if this works ;)

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

No branches or pull requests

1 participant