You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 3, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Mar 3, 2023. It is now read-only.
Hitting an unbound key sequence sharing a prefix with a bound sequence freezes atom #11203
Atom freezes or crashes when a non-bound key binding shares the same prefix as a bound key binding.
Steps to Reproduce
Create an example keybinding in your keymap file; (this is a trivial example; while they make Atom effectively non-functional, these types of bindings are, I expect, not so uncommon for us vim mode folk):
'atom-text-editor':
'space b d': 'tabs:close-tab'
Hitting space, b, d will delete the tab as expected.
Now: instead, hit space b y (or any other unbound key).
Expected behavior: Nothing happens.
Actual behavior: Atom freezes for an extended time. Attempting this in safe mode crashes, otherwise it freezes and eventually shows a stack trace referenced in #6102. However, this does not appear to be the same issue from what is being discussed there. Development console in addition shows:
An additional note: it seems to me that I need to have a bound / unbound shortcut of >=3 characters to trigger this. Almost all of my prefixes, as a result of vim mode, start with space (space being a pseudo leader key): for example: space g s for git status. However, if I press space, followed by the next letter which has no bindings (e.g., I have nothing that starts with space y), then there is no problem.
I haven't had a chance to dive into this deeply yet, but anecdotally, the three or four times I've heard this reported, the leader key has been the space key.
@BinaryMuse I can confirm that this only happens with the space key as the leader key. I added ', r t': 'rspec:run-for-line' to my keymap.cson, then hit comma r f and atom did not crash.
Hi, I've managed to write a failing spec ** in atom-keymap. See the PR referenced above.
Update: Sorry closed that PR above, the fix was causing replayed input events to double up. I've also made the spec failure case a very simple new keybind that interferes with the d o g case' rather than new cases.
Anyone feel free to carry on where I've left off. I think we need to maintain the disabled binds between replays somehow, but without breaking the replay system. As the source suggest, there are dragons.
This was caused by an unforeseen corner of @benogle's changes to support keyup events, which is used in MRU tabs. I'm looking into a quick solution, but keystroke matching needs a rethink.
Okay, I fixed at least one issue in 1.7.0-beta4. Can folks give it a try and comment here if there are other cases I missed? Keymap matching code is reaching critical crazy.
This issue has been automatically locked since there has not been any recent activity after it was closed. If you can still reproduce this issue in Safe Mode then please open a new issue and fill out the entire issue template to ensure that we have enough information to address your issue. Thanks!
Activity
BinaryMuse commentedon Mar 18, 2016
Thanks for the report! A similar issue came up in the #atom Slack channel as well, I'll take a look at this soon.
dpavlic commentedon Mar 20, 2016
An additional note: it seems to me that I need to have a bound / unbound shortcut of >=3 characters to trigger this. Almost all of my prefixes, as a result of vim mode, start with space (space being a pseudo leader key): for example:
space g sfor git status. However, if I press space, followed by the next letter which has no bindings (e.g., I have nothing that starts withspace y), then there is no problem.jessejanderson commentedon Mar 23, 2016
Man, this bug is brutal—apparently I press a lot of incorrect shortcut keys.
Having to force quit Atom several times a day in it's current state.
dragonxlwang commentedon Mar 23, 2016
Thanks @dpavlic for pointing me to the correct place.
Hope this issue to get fixed soon as I am a sloppy typing guy
BinaryMuse commentedon Mar 24, 2016
I haven't had a chance to dive into this deeply yet, but anecdotally, the three or four times I've heard this reported, the leader key has been the space key.
calebmeyer commentedon Mar 24, 2016
@BinaryMuse I can confirm that this only happens with the space key as the leader key. I added
', r t': 'rspec:run-for-line'to my keymap.cson, then hitcomma r fand atom did not crash.dpavlic commentedon Mar 24, 2016
@BinaryMuse Changing the leader seems to stop the behaviour on this end as well. I'm going to remap the leader for now and test it out some more.
dpavlic commentedon Mar 24, 2016
I was too hasty, remapping all the keys to the comma brings the problem back...
dragonxlwang commentedon Mar 24, 2016
@dpavlic In my case I was using "," for leader key in vim-mode and I got this problem all the time after updating.
jackcasey commentedon Mar 30, 2016
Hi, I've managed to write a failing spec ** in atom-keymap. See the PR referenced above.
Update: Sorry closed that PR above, the fix was causing replayed input events to double up. I've also made the spec failure case a very simple new keybind that interferes with the
d o gcase' rather than new cases.Anyone feel free to carry on where I've left off. I think we need to maintain the disabled binds between replays somehow, but without breaking the replay system. As the source suggest, there are dragons.
Simple reproduction of broken playback recursion
nathansobo commentedon Mar 30, 2016
This was caused by an unforeseen corner of @benogle's changes to support keyup events, which is used in MRU tabs. I'm looking into a quick solution, but keystroke matching needs a rethink.
nathansobo commentedon Mar 30, 2016
Okay, I fixed at least one issue in 1.7.0-beta4. Can folks give it a try and comment here if there are other cases I missed? Keymap matching code is reaching critical crazy.
dpavlic commentedon Mar 31, 2016
All looks good so far on the 1.7.0-beta4. Thank you nathansobo and jackcasey.
jackcasey commentedon Apr 4, 2016
Yay! Thanks for the fix. All works for me. Will save me 10 sighs a day at least :)
lock commentedon Apr 10, 2018
This issue has been automatically locked since there has not been any recent activity after it was closed. If you can still reproduce this issue in Safe Mode then please open a new issue and fill out the entire issue template to ensure that we have enough information to address your issue. Thanks!