While VSCode supports opening terminals in the editor area, its shortcuts are generally hard-coded to deal with the terminal in the bottom-panel. To change this, we can define keyboard shortcuts to mitigate and make the "ctrl+`" functionality toggle between the terminal and the last editor used.
Last active
January 27, 2025 22:34
-
-
Save adduc/ef09bba1b0722422b4a03a844687cec6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
[ | |
// Override the default keybinding for opening the terminal | |
{ | |
"key": "ctrl+`", | |
"command": "noop", | |
"when": "terminal.active" | |
}, | |
// When no terminals are open, open a new terminal | |
{ | |
"key": "ctrl+`", | |
"command": "workbench.action.terminal.new", | |
// @see https://github.com/microsoft/vscode/issues/211877#issuecomment-2091519337 | |
"when": "!terminalGroupCount" | |
// "when": "!terminalCount" | |
}, | |
// When at least one terminal is open, focus on the terminal | |
{ | |
"key": "ctrl+`", | |
"command": "workbench.action.terminal.focus", | |
"when": "terminalCount" | |
}, | |
// When focus is currently on terminal, switch to the previous editor | |
{ | |
"key": "ctrl+`", | |
"command": "workbench.action.openPreviousRecentlyUsedEditor", | |
"when": "terminalFocus" | |
}, | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment