Visual Studio Code - Terminal alt tab keyboard shortcut

21 November 2016

Configuring your own keyboard shortcuts in Visual Studio code is fairly easy once you know which settings to change but finding the right command can often take a few seconds too many.

To configure keybaord shortcuts for quick window switching in the terminal, do the following.

  1. Open VS Code, if it isn’t already.
  2. File > Preferences > Keyboard Shortcuts. This will open two editor windows:
    “Default Keyboard Shortcuts” and “keybindings.json”.
  3. In the “keybindings.json” file, add the following between the array brackets [ ]
	{ "key": "ctrl+shift+[", "command": "workbench.action.terminal.focusPrevious", "when": "terminalFocus" },  
	{ "key": "ctrl+shift+]", "command": "workbench.action.terminal.focusNext", "when": "terminalFocus" }

And you’re done!
If you want to mess around with other commands, there’s a list of unused commands at the bottom of the “Default Keyboard Shortcuts” editor window.

Bonus hint: You can add a keybinding for workbench.action.terminal.focus but I find the ctrl+` shortcut which toggles the terminal window to be sufficient for this (double press it if your terminal is already open).


More about software-development

Agile Software Development - The Eye Glaze Test

A couple of years ago, I was managing a team of developers at Fairfax Media to build the new Australian Financial Review website. We started...

Git repositories and big binary files

Update: Use Git Large File Storage

GitHub and Bitbucket now both have support for Git Large File Storage or Git LFS. Basically, this implementation...

About Me

I'm a software developer by profession with a wealth of both dev management and programming experience.

My programming background is varied and includes .NET, C#, Node JS, React, Flavours of SQL, Xamarin and Unity among other things.

I spend a great deal of my spare time doing game and web development, writing music and relaxing with my family.

Ping me on Twitter: @panetta