Very convenient way to switch between editor and terminal with maximize the window by the default shortcut Ctrl+`
{
// disable default rule
"key": "ctrl+`",
"command": "-workbench.action.terminal.toggleTerminal",
},
{
// Open the terminal, if wasn't
"key": "ctrl+`",
"command": "workbench.action.togglePanel",
"when": "!terminalIsOpen"
},
{
// Hide the terminal, if editor is active
"key": "ctrl+`",
"command": "workbench.action.togglePanel",
"when": "terminalIsOpen && !terminalFocus"
},
{
// Maximize the terminal, if it's in the focus and editor is opened
"key": "ctrl+`",
"command": "runCommands",
"args": {
"commands": [
"workbench.action.toggleMaximizedPanel",
]
},
"when": "terminalIsOpen && !editorFocus && !panelMaximized"
},
{
// Toggle the terminal and focus on editor, if terminal was maximazed
"key": "ctrl+`",
"command": "runCommands",
"args": {
"commands": [
"workbench.action.toggleMaximizedPanel",
"workbench.action.focusActiveEditorGroup",
]
},
"when": "terminalIsOpen && !editorFocus && panelMaximized"
},