Making the terminal easier to navigate

Key binding to change pane focus

So now it’s a little easier to see that we’re in the terminal, but how do we get there?

By default ctrl+` toggles the terminal open and closed. But usually, you want to leave the terminal open and just toggle focus between it and an editor window. To do that, you can add the following to your keybindings.json file:

{

"key": "ctrl+`",

"command": "workbench.action.terminal.focus",

"when": "!terminalFocus"

},

{

"key": "ctrl+`",

"command": "workbench.action.focusActiveEditorGroup",

"when": "terminalFocus"

}

Name your terminal windows

I felt very clever one day when I figured out how to change the names on my Terminal tabs. You can do the same thing in VS Code, so when you have multiple terminals going you don’t have to guess which one you need.

With the terminal you want to name active, use the command menu (again, command+shift+p ) and start typing “terminal: rename”, and select that option. Type the name you want and press return/enter and voilá.

(You could also add a keyboard shortcut for this command: workbench.action.terminal.rename , but VS Code doesn’t have one by default.)

Next and previous terminals

The last thing I thought would be handy is to navigate through the terminal windows without using the little pulldown menu. You can add a couple more keyboard shortcuts to do just that:

{

"key": "ctrl+shift+right",

"command": "workbench.action.terminal.focusNext"

},

{

"key": "ctrl+shift+left",

"command": "workbench.action.terminal.focusPrevious"

},

By the way, to create a new terminal, the shortcut is ctrl+shift+` .

A couple possibly useful extras

There is a setting that turns on a warning if you try to close a window while there are active terminal windows:

"terminal.integrated.confirmOnExit": true

Unfortunately, it warns you whether there is an active running process in the terminal or not, so it’s a little obtrusive.

For processes that you know in advance you want to keep running, even if you quit VS Code or close a workspace, you can launch an external terminal program with shift+cmd+c . And, you can change the editor it opens with this setting:

"terminal.external.osxExec": "YourFaveTerminal.app"

More stuff

There are lots more ways to customize the terminal if you are all about the command line: