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

shift+escape behaviors differently on VSCode and Intellij (macOS) #103

Closed
xc1427 opened this issue Jan 15, 2018 · 4 comments · Fixed by #349
Closed

shift+escape behaviors differently on VSCode and Intellij (macOS) #103

xc1427 opened this issue Jan 15, 2018 · 4 comments · Fixed by #349
Assignees
Labels
Milestone

Comments

@xc1427
Copy link

xc1427 commented Jan 15, 2018

I examined source code of this repo related to shift+escape key-bindings. They are as below,

           {
                "key": "shift+escape",
                "mac": "shift+escape",
                "command": "workbench.action.toggleSidebarVisibility",
                "when": "!editorFocus && !terminalFocus && !problemFocus && !inDebugRepl",
                "intellij": "Hide active or last active window (Sidebar)"
            },
            {
                "key": "shift+escape",
                "mac": "shift+escape",
                "command": "workbench.actions.view.problems",
                "when": "problemFocus",
                "intellij": "Hide active or last active window (Problems)"
            },
            {
                "key": "shift+escape",
                "mac": "shift+escape",
                "command": "workbench.debug.action.toggleRepl",
                "when": "inDebugRepl",
                "intellij": "Hide active or last active window (Debug Console)"
            },
            {
                "key": "shift+escape",
                "mac": "shift+escape",
                "command": "workbench.action.terminal.toggleTerminal",
                "when": "terminalFocus",
                "intellij": "Hide active or last active window (Terminal)"
            },

IMHO, this configuration only partially respects behavior on Intellij, as on Intellij esc+shift will hide the last open window even when editor has focus. I see it is impossible to have a perfect match on VSCode because of its limited context clause. But I think the following code can be a nearly neat and simplified configuration.

   {
        "key": "shift+escape",
        "command": "workbench.action.toggleSidebarVisibility",
        "when": "sidebarVisible"
    },
    {
        "key": "shift+escape",
        "command": "workbench.action.terminal.toggleTerminal",
        "when": "terminalFocus"
    },
@xc1427
Copy link
Author

xc1427 commented Jan 16, 2018

FYI, the newly added sidebarVisible context seems to have bug. I filed an issue for VSCode microsoft/vscode#41645

@xc1427
Copy link
Author

xc1427 commented Jan 16, 2018

FYI, VSCode seems to have a workbench.action.togglePanel to toggle the bottom Panel (terminal, debug console, etc) , although it is not documented.

@spik3s
Copy link
Contributor

spik3s commented Jan 16, 2018

What about if we just edit this:

{
    "key": "shift+escape",
    "mac": "shift+escape",
    "command": "workbench.action.toggleSidebarVisibility",
    "when": "!editorFocus && !terminalFocus && !problemFocus && !inDebugRepl",
    "intellij": "Hide active or last active window (Sidebar)"
}

and replace "when" with a line with removed !editorFocus &&

"when": "!terminalFocus && !problemFocus && !inDebugRepl"

My initial testing suggests that this solves the issue. What do you think?

@xc1427
Copy link
Author

xc1427 commented Jan 16, 2018

@spik3s Sorry, but this does not solve the issue. With your key bindings I still got sidebar open. But the expected behavior is to always close sidebar when Shift+ESC is hit. Could you please re-test it ?

This is my environment:
macOS version: 10.13.1
VSCode Version: 1.19.2

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

Successfully merging a pull request may close this issue.

3 participants