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 }}
Repository navigation
Linux: commands with keybindings ignore when clause of the command if defined #26318
*duplicateIssue identified as a duplicate of another issue(s)bugIssue identified by VS Code Team member as probable bugupstreamIssue identified as 'upstream' component related (exists outside of VS Code)
When I am using git and I am entering a commit message, by pressing ctrl+enter to commit the message, the editor commits it but it also goes into zen mode. Based on my when statement, it shouldn't do that since I am using editorTextFocus.
I could reproduce on Linux.
It is happening because Toggle Zen Mode is in the menus. i.e. the Toggle Zen Mode action is triggered via electron's menus keybinding listeners and via ipc, not via the keybindings service.
Benjamin Pasero (@bpasero) I am not sure what the fix should be. We would need to know if a menu action got triggered by the menus via electron's keybindings listener and re-evaluate the when condition (as opposed to getting triggered via mouse click or selecting it via keyboard).
i.e. in other words, showing a keybinding next to a menu action means adding a keybinding in our system without the when condition since Electron dispatches it and then we blindly execute the action without evaluating the when condition.
changed the title [-]ctrl+enter is executing keybinding in "Source Control" message to commit[/-][+]Linux: commands with keybindings ignore when clause of the command if defined[/+]on May 10, 2017
*duplicateIssue identified as a duplicate of another issue(s)bugIssue identified by VS Code Team member as probable bugupstreamIssue identified as 'upstream' component related (exists outside of VS Code)
Activity
alexdima commentedon May 10, 2017
I could reproduce on Linux.
It is happening because Toggle Zen Mode is in the menus. i.e. the Toggle Zen Mode action is triggered via electron's menus keybinding listeners and via
ipc, not via the keybindings service.alexdima commentedon May 10, 2017
Benjamin Pasero (@bpasero) I am not sure what the fix should be. We would need to know if a menu action got triggered by the menus via electron's keybindings listener and re-evaluate the
whencondition (as opposed to getting triggered via mouse click or selecting it via keyboard).i.e. in other words, showing a keybinding next to a menu action means adding a keybinding in our system without the
whencondition since Electron dispatches it and then we blindly execute the action without evaluating thewhencondition.bpasero commentedon May 10, 2017
As far as I know there is no way for us to know if a menu item was triggered via mouse of keybinding. There is an event object on the menu item (https://github.com/electron/electron/blob/master/docs/api/menu-item.md#new-menuitemoptions) but this one only seems to be triggered when clicked via mouse and not when triggered via keybinding.
[-]ctrl+enter is executing keybinding in "Source Control" message to commit[/-][+]Linux: commands with keybindings ignore when clause of the command if defined[/+]bpasero commentedon Nov 13, 2017
Marking as duplicate of #35225