Search code examples
visual-studio-codewebstorm

How to make console and tree "unpinned"?


I want to simulate behavior of WebStorm: when I set console as "Dock Unpinned" it closes if it loses focus. I can press Esc, that switches focus to editor, and the console is closing. The same with the project tree (or "Explorer" in VS Code).

How to copy this behavior?

enter image description here


Solution

  • Give these keybindings a try:

    {
      "key": "ctrl+`",
     "command": "workbench.action.togglePanel",
      "when": "panelFocus || editorFocus"
    },
    {
      "key": "ctrl+`",
      "command": "workbench.action.maximizeEditor",
      "when": "sideBarFocus"
    },
    {
      "key": "ctrl+`",
      "command": "-workbench.action.terminal.toggleTerminal"
    },
    

    I tried to make various combinations work with esc but there are just too many terminal conflicts with the esc key.

    The Ctrl+backtick is interesting since it usually works to toggle the terminal. You don't necessarily need that last disabled keybinding but with toggleTerminal disabled Ctrl+backtick will return you to whichever view in the Panel you were working on previously - like Search, Problems, etc. instead of only to the terminal.

    toggle explorer and terminal


    Let me know if this is what you were looking for.