Does anyone know the keyboard shortcut (Mac and Linux) to switch the focus between editor and integrated terminal in Visual Studio Code?
-
76`ctrl ` + ' ` ' will be the best `#-> Linux` – muthukumar selvaraj Jan 24 '18 at 15:40
-
47ctrl + ' ` ' works also on OS X without any additional key binding. – nataliastanko Feb 05 '19 at 03:25
-
19`ctrl` + ' ` ' works with Windows flawlessly too! – Ehtesham Z Jan 13 '20 at 22:07
-
`alt` + `up/down left/right arrows` to switch between splitted terminals – Gabriel Petersson Jul 16 '20 at 19:09
-
15The problem with `CTRL`+`\`` is that it creates a new terminal even if one already exists. – Guss Aug 23 '20 at 08:26
-
12@Guss not anymore (v1.55.0) – danno Apr 26 '21 at 00:48
-
seems to be `CTRL` + `'` now. works for me on windows – Pere Jul 20 '21 at 22:09
-
2cmd+j works in mac – Abhishek Jaiswal Jan 21 '22 at 04:59
-
1Yo, I gave you your 1000th upvote. Can you imagine? Such a question for 10k rep - well done. All the comments about `ctrl + \`` are missing the part about `ctrl + 1` – Nathan Chappell Oct 25 '22 at 12:36
27 Answers
While there are a lot of modal toggles and navigation shortcuts for VS Code, there isn't one specifically for "move from editor to terminal, and back again". However you can compose the two steps by overloading the key
and using the when
clause.
Solution
You can achieve the desired effect by adding the appropriate settings to the keybindings.json
file. Here are the required steps:
Open the Command Palette (Ctrl+Shift+P Windows/Linux or ⇧ ⌘ P Mac).
Type "Preferences: Open Keyboard Shortcuts (JSON)" and press Enter.
Add the following entries to the
keybindings.json
file:
// Toggle between terminal and editor focus
{
"key": "ctrl+`",
"command": "workbench.action.terminal.focus"
},
{
"key": "ctrl+`",
"command": "workbench.action.focusActiveEditorGroup",
"when": "terminalFocus"
}
With these shortcuts you can focus between the editor and the Integrated Terminal using the same keystroke.
NOTE
The key combination suggested here is now built into VSCode as a default (as of 1.72.2, maybe earlier) . See if ctrl + ` works before attempting to add it.
NOTE
In modern versions of VS Code (as of 2022) the Default Keyboard Shortcuts (JSON) file is read-only, so that is why for the custom settings you need to edit a separate dedicated file keybindings.json
.
More info can be found on the official Visual Studio documentation page:

- 12,746
- 4
- 52
- 44

- 18,876
- 1
- 17
- 26
-
65By far, this is the best answer as the most ergonomically justified solution: extending the existing key binding. Kudos! – mloskot May 25 '17 at 15:53
-
12Thanks, this worked fine and saves a lot of time. For users of international keyboards: `"ctrl+\`"` can be specified as `"ctrl+oem_3"`. – esel Oct 09 '17 at 12:13
-
1@wgj, I think VS Code does this by default, at least right now ( with newest update). Or am I missing something? – Roman Nov 17 '17 at 14:44
-
13@Roman 1.18.0's behavior is certainly an improvement since when I wrote my answer, but I think the above is still better. The difference is the terminal won't disappear when using the keystroke, only the focus will shift. I happen to like keeping my terminal displayed :) – wgj Nov 19 '17 at 06:34
-
1
-
And if you want to close the terminal, use `exit` command then you don't even have to touch your mouse at all time :) – Joshua Dec 12 '17 at 03:14
-
45Note that these shortcuts should be pasted to the `keybindings.json` file. – pseudomarvin Mar 23 '18 at 13:44
-
61Open the keybindings.json from the editor: `CMD-SHIFT-P` -> `Preferences: Open Keyboard Shortcuts File`. Also a nice resource: https://code.visualstudio.com/docs/getstarted/keybindings – derFunk Apr 23 '18 at 12:53
-
2For Japanese keyboards, it may be useful to use `"ctrl+shift+oem_3"` instead of ``"ctrl+`"``. `"ctrl+shift+oem_3"` means `"ctrl+shift+@"`, which is equivalent to ``"ctrl+`"`` in Japanese keyboards. – nekketsuuu Aug 22 '18 at 23:07
-
2
-
1This should be the default behavior, I tried to work without it but ended up using it again in the end. And since I had previously upvoted this answer I'm leaving a comment this time. – Emilio Bool Jan 08 '19 at 01:02
-
1I needed to add a when clause for both bindings: `{ "key": "ctrl+$", "command": "workbench.action.terminal.focus", "when": "!terminalFocus"}, { "key": "ctrl+$", "command": "workbench.action.focusActiveEditorGroup", "when": "terminalFocus"}` – MonsieurDart Sep 18 '19 at 10:07
-
5This answer is like 2 years old: VS Code people, why haven't you built this in yet? ;) – machineghost Oct 09 '19 at 17:31
-
3Pressing "ctrl+`" when in terminalFocus used to toggle visibility of the terminal (of the Panel). After this modification you can do this with "ctrl+j". – Thanasis Mattas Dec 23 '19 at 13:09
-
I must be doing something wrong, but when I'm in the terminal window, `ctrl+\`` brings focus back to the editor but it closes the terminal. Is there a way to keep the terminal open? – chizou Apr 18 '20 at 23:58
-
1@majikman Sounds like you have to do what is described in this answer and edit the Keyboard Shortcuts File. – KevinVictor May 19 '20 at 18:33
-
1The latest version (as on 10 June 2020) of Code does not allow you to edit the keybindings.json file (says read-only). You will have to find this file and edit it using an external editor. – La Machine Jun 10 '20 at 11:36
-
1This has been built in VSC now! So you only have to know the button combinations that are explained in Rahul Shukla's answer. – Nander Speerstra Jul 16 '20 at 11:17
-
1@NanderSpeerstra You could do what Rahul suggested at the time this answer was provided. This answer instead focuses on using the *same* keystroke to show and hide the terminal. :) – wgj Jul 16 '20 at 21:07
-
1On French azerty, I needed @MonsieurDart solution for this to work, adding "!terminalFocus" to the terminal binding too. Otherwise it somehow stay focused in the terminal. – Eric Burel Jul 22 '20 at 14:23
-
3@LaMachine There is still a way to define custom shortcuts. If you press (cmd+s cmd+k) it will open the Keyboard Shortcuts page. Then, if you look up at the top-right there is an icon that looks like a page with an arrow on it. If you hover it it will say `Open Keyboard Shortcuts (JSON)`. Click that and you will be able to add new shortcuts or override shortcuts like what was presented here. On macOS this file is located at `/Users/{user}/Library/Application Support/Code/User/keybindings.json`. Not sure about any other OS – mkturner Aug 04 '20 at 14:51
-
1I actually logged in just to give you the respect you deserve for this answer. I hate using the mouse when I don't have to. Thank you again for posting this answer. – ju.skinner Aug 05 '20 at 01:41
-
1ctrl + j works like ctrl + ` . So I set ctrl + j for focus and kept ctrl + ` to show/hide the panel. – Reza Taba Sep 28 '20 at 15:35
-
If you sort your keybindings like I just did, note that the one with the `when` has to come _after_ the one without. – Denis Howe Oct 13 '20 at 16:42
-
1I didn't set up my vs code for this shortcut and when I wanted to set it up it was already there. So if you are using an updated version, you should see this is already set as a default with this key bindings. – Khandakar Rashed Hassan Jan 11 '21 at 18:07
-
1I use a few different very ergonomic keyboards (eg. Kinesis Advantage with Dvorak layout, and an EngoDox EZ), and ctrl+\` isn't something that is easy to reach. But I found that shift+space is available and works very nicely. – Cameron Kerr Apr 08 '21 at 04:43
-
@CameronKerr I use a Kinesis with Colemak now, and can no longer take advangate (heh) of my own suggestion. Heck, I don't even use VS Code anymore! – wgj Apr 09 '21 at 22:07
-
1Works for me with ctrl key on mac. But when i'm trying to apply it to "cmd+`" instead of "ctrl+`", it doesn't work. Anyone? – vladli Apr 21 '21 at 08:30
-
-
I was used to open the terminal with `ctrl + j` , your answer improved clearly my dev experience, now I can toggle betwen code and terminal with only `ctrl + j` – gBusato Jan 06 '22 at 10:23
-
Per default ctrl+` will move the cursor from editor to terminal and then back to the editor but closing the terminal on Mac. – Timo Mar 29 '22 at 20:42
-
Hi, for some reason, it did not work as described. I needed to add `"when": "editorTextFocus"` to the first entry. Now works, thanks for the solution! – Ingmar Apr 12 '22 at 10:05
-
1According to the answer, as of 2022, evidently, we have to create a separate dedicated file `keybindings.json` to edit the key bindings. Where do we save this file? I tried saving it in a `.vscode` folder in my local workspace and it doesn't work. – snow May 29 '22 at 07:30
-
On Mac this does not work for me at all. In fact `cmd+[Backquote]` won't even register by VS Code despite it being a common keyboard shortcut to switch between open windows in most apps and works as expected in every other app I've tried except VS Code. – user24601 Jan 31 '23 at 19:13
-
-
-
Note: the "NOTE" should be now on top of the post as this answer starts off with outdated and invalid information – J D Aug 09 '23 at 20:47
ctrl+` : To Focus on Integrated Terminal
ctrl+1 : To Focus on Editor (If editor-2 command would be ctrl+2)
More Info : https://medium.com/p/21969576c09c

- 7,365
- 3
- 15
- 26
-
24
-
22
-
12Thank you. Ctrl + 1 is what I need, as in some case, ctrl+` will open external terminal and cannot use that again to comeback to VSCode editor – Thang Nguyen May 23 '19 at 08:58
-
4Control + '~' will work for the toggling between the two. I'm using from quite some time. – surender pal Jul 31 '19 at 16:34
-
This is very useful if you just looked for all references and want to move the focus from the sidebar to the editor without closing the sidebar as well. I mean, the Ctrl + ` works, but this works for different cases (like mine), I was ctrl + ` twice to get where I wanted from the sidebar. – Rafael Merlin Oct 30 '19 at 04:38
-
6@surenderpal ctrl+'~' creates new terminal, it doesn't switch focus to the existing one. – Kajsa Gauza Jan 16 '20 at 11:26
-
thx its very difficult to see the backtick in the dropdown menu of vscode. of course the devs at MSFT working on 40" monitors wouldn't realize this – Max Wen Feb 24 '20 at 02:52
-
1I have a keyboard where a "½§" button is located below the Esc key. Moreover, there is a key containing "`" and "´" on the left side of backspace. – jeppoo1 Feb 28 '20 at 07:36
-
1
-
I love it when discovering builtin key-bindings. Very simple and keys are next to each other. – redeemefy Jul 05 '20 at 21:24
-
Worked for me on VS Code (on Ubuntu) without any extra key binding. – Abinash Dash Jul 29 '20 at 18:28
-
Note the actual command names (for finding in keyboard shortcuts) are "Terminal: Focus Terminal" and "View: Focus First Editor Group". – studgeek Nov 07 '20 at 01:08
-
-
The `\`` key is right next to the `1` key... this is a great solution. – Elijah Mock Aug 31 '23 at 16:12
Ctrl+J works; but also shows/hides the console.
cmd+J for mac

- 19,880
- 21
- 76
- 94

- 2,157
- 1
- 7
- 4
-
33
-
3
-
2You can use the same hack from the accepted answer as well for cmd+j `{ "key": "cmd+j", "command": "workbench.action.terminal.focus"}, { "key": "cmd+j", "command": "workbench.action.focusActiveEditorGroup", "when": "terminalFocus"}` That way I don't have to take my hands off home row. – Clintm Feb 15 '21 at 04:17
-
-
2Did not know this existed, otherwise I would not have tried the examples above, this should be the accepted answer (MacOS 12.0.1) – JVGD Dec 13 '21 at 10:44
-
You can also hit `Cmd`+`J` **twice** to focus Editor instead of weird finger Yoga `Ctrl`+`1` – sFritsch09 Sep 04 '22 at 12:43
A little late to the game but I configured mine as the following in the keybindings.json
:
{
"key": "ctrl+`",
"command": "workbench.action.terminal.focus",
"when": "editorTextFocus"
},
{
"key": "ctrl+`",
"command": "workbench.action.focusActiveEditorGroup",
"when": "terminalFocus"
},
{
"key": "alt+`",
"command": "workbench.action.terminal.toggleTerminal"
}
I wanted separate keys for opening/closing terminal and switching focus back and forth between the windows.
-
5Mapping `alt+\`` seems to be buggy - tracked at https://github.com/Microsoft/vscode/issues/41024#issuecomment-363096692 – Ben Creasy Mar 10 '18 at 06:24
-
3I found `alt` easier to press than `ctrl`, so in my configuration it's the other way round. – xji Oct 09 '18 at 17:42
-
This is a great proposal, although I opted for keeping the original bindings and using ```alt``` to switch focus. – Mr. Duhart Jan 03 '19 at 16:43
-
As of version : 1.26.1 (linux), the shortcut is not set by default. To set the shortcut
- open keyboard shortcuts panel [ctrl + k , ctrl + s]
- Search for Focus Terminal
- Set your shortcut
For editor focus is already set by default.

- 876
- 1
- 9
- 17
-
As they provide additional keyboard mappings, this answer is simpler and faster – LookAheadAtYourTypes Oct 24 '18 at 09:05
-
This focuses the first editor group - might not be what the OP wants. Probably wants the current/active editor group. – Mark Jan 27 '20 at 18:39
-
1
-
I configured mine as following since I found ctrl+` is a bit hard to press.
{
"key": "ctrl+k",
"command": "workbench.action.focusActiveEditorGroup",
"when": "terminalFocus"
},
{
"key": "ctrl+j",
"command": "workbench.action.terminal.focus",
"when": "!terminalFocus"
}
I also configured the following to move between editor group.
{
"key": "ctrl+h",
"command": "workbench.action.focusPreviousGroup",
"when": "!terminalFocus"
},
{
"key": "ctrl+l",
"command": "workbench.action.focusNextGroup",
"when": "!terminalFocus"
}
By the way, I configured Caps Lock to ctrl on Mac from the System Preferences => keyboard =>Modifier Keys
.
Another option is to use F6
and shift+F6
.
F6
does "Focus Next Part", which will move focus from the editor to Panel below (Terminal, Output, Debug Console, etc).
shift+F6
does "Focus Previous Part", which will move focus from Terminal panel back to editor.
The advantage of this over ctrl + `
is that:
It does not hide the Terminal/Panel (if that's what you prefer. If you prefer to hide/unhide the Terminal, then just use
ctrl + `
).This will work with any of the Panels (Terminal, Output, Debug Console, etc).

- 33,218
- 10
- 150
- 101
Hey my steps to make this work were:
ctrl + shift+ p
and look forpreferences: keyboard shortcuts
or you can use ctrl k + ctrl s
to open it directly
Look in the search box for
Terminal: Focus Terminal
, I set up for myselfalt + T alt + T
but you can select the combination that you wantLook in the search box for
View: Focus Active Editor Group
, set up for myselfalt + E alt + E
but again you can select the combination that you want
That's it, I hope this help

- 450
- 3
- 10
-
1I matched it with tmux ctrl + a down and ctrl + a up and now I can work like I do in tmux... thanks – Snehal Parmar Jan 17 '22 at 11:11
The default keybinding to toggle the integrated terminal is "Ctrl+`" according to VS Code keyboard shortcuts documentation page. If you don't like that shortcut you can change it in your keybindings file by adding something similar to:
{ "key": "ctrl+l", "command": "workbench.action.terminal.toggleTerminal" }
There does not seem to be a default keybinding for simply focusing the bottom panel. So, if you do not want to toggle the bottom panel, you will need to add something similar to the following to your keybindings file:
{ "key": "ctrl+t", "command": "workbench.action.focusPanel" }
-
Perfect, Thanks! I'm looking for the second answer you mentioned. If anyone wondering about the keyboard shortcut to put the focus back to editor then it is: Command + 1 (on Mac) – Abhijeet Mar 14 '17 at 22:59
-
1I think `focusPanel` is for the general region (include things like "Problems", "Output" and "Debug Console". There's also an action specifically for the Integrated Terminal `workbench.action.terminal.focus`. – wgj Mar 25 '17 at 05:18
-
ctrl + 1 on windows will put focus back on the editor if you have used ctrl + ` to focus on the integrated terminal. then just ctrl + either 1 or ` for editor and terminal to go back and forth – john-g Aug 05 '23 at 17:44
Try using ctrl+` to toggles the visibility of the terminal and as a result toggle the focus.

- 191
- 1
- 10
Generally, VS Code uses ctrl+j
to open Terminal, so I created a keybinding to switch with ctrl+k
combination, like below at keybindings.json
:
[
{
"key": "ctrl+k",
"command": "workbench.action.terminal.focus"
},
{
"key": "ctrl+k",
"command": "workbench.action.focusActiveEditorGroup",
"when": "terminalFocus"
}
]

- 9,564
- 146
- 81
- 122

- 1,368
- 16
- 26
-
1Not exactly. By default `ctrl+j` just toggles Panel. So if last used Panel view was e.g. 'Problems' you will jump there instead of terminal. Also `ctrl+k` is widely used as chord beginning so overriding it will break a lot of shortcuts. – jetpack_guy Aug 06 '21 at 07:23
Here is a way to add your own keybinding for switching focus.
- Open your VSCode
- Press
Ctrl+Shift+P
and search for keyboard shortcuts and hit this (Preferences: Open Keyboard shortcuts). - Search for 'focus terminal' in the search panel and find this option (Terminal: Focus on Terminal View) and click on the plus icon.
- Enter the shortcut as you like which is not used and hit Enter.
- Go to Editor mode and try using your shortcut.
- Now hit
Alt+Shift+T
to go to the terminal. - Want to go back to the editor? Just Hit
Ctrl+tab
Tested on Windows 10 machine with VSCode(1.52.1)

- 148
- 2
- 13
The answer by Shubham Jain is the best option now using the inbuilt keyboard shortcuts.
to Ctrl + ;
to Ctrl + L
This way you can have move focus between terminal and editor, and toggle terminal all in close proximity.

- 12,241
- 27
- 68
- 82

- 331
- 1
- 3
- 7
-
This solved it for me! **Keyboard shortcuts** --> **Terminal: Focus Terminal** (*workbench.action.terminal.focus*) --> changed the **Keybinding** to my desired combination. Running on vscode Insiders 1.43.0 – jeppoo1 Feb 28 '20 at 07:34
What's working for my 1.56 VS Code is:
Ctrl + ~ to focus on terminal window from editor
Ctrl + 9 to focus back on editor from terminal

- 1,082
- 14
- 16
SIMPLE WINDOWS SOLUTION FOR ANY KEYBOARD LAYOUT (may work for other OS but not tested)
I use a Finnish keyboard so none of the above worked but this should work for all keyboards.
- Terminal focus: Hover your mouse over the terminal text in the integrated terminal. The shortcut for focusing on the terminal will pop up - mine for example said CTRL+ö.
- Editor focus: as mentioned above use CTRL+1.

- 444
- 1
- 8
- 18
-
1Thank you, thank you, thank you! So simple, and so easily overlooked. This is by far the best answer in here. – Terje Mikal Mar 17 '21 at 09:57
It's not exactly what is asked, but I found it very useful and related.
If someone wants to change from one terminal to another terminal also open in the integrate terminal panel of Visual Studio, you can search for:
Terminal: Focus Next Terminal
Or add the following key shortcut and do it faster with keyboard combination.
{
"key": "alt+cmd+right",
"command": "workbench.action.terminal.focusNext",
"when": "terminalFocus"
},
{
"key": "alt+cmd+left",
"command": "workbench.action.terminal.focusPrevious",
"when": "terminalFocus"
},
100% Working Settings...
[
{ "key": "alt+right", "command": "workbench.action.terminal.focus"},
{ "key": "alt+left", "command": "workbench.action.focusActiveEditorGroup", "when": "terminalFocus"}
]
workbench.action.terminal.focus : To switch from editor to terminal. workbench.action.focusActiveEditorGroup : To switch from terminal to editor.

- 195
- 2
- 15
Actually, in VS Code 1.48.1, there is a toggleTerminal
command; I don't know if it was available in previous versions ;) You can utilize it in the keybindings.json
file.
This worked for me on Windows, and should also works on Linux.
{
"key": "ctrl+alt+right",
"command": "workbench.action.terminal.toggleTerminal",
"when": "editorTextFocus || terminalFocus"
}
For ctrl+` combination to switch between, I tried all of listed answers, but no luck. For those who has similar issue like mine, try the following shortcut within keybindings.json
: Tested on VSCode 1.59+
[
{
"key": "ctrl+oem_8","command": "workbench.action.terminal.focus", "when": "!terminalFocus"
},
{
"key": "ctrl+oem_8","command": "workbench.action.focusActiveEditorGroup", "when": "terminalFocus"
}
]

- 4,910
- 5
- 31
- 51
-
Using a simple backtick instead of `oem_8` works like a champ on OSX. The rest of the rules work brilliantly! – brnt Jan 02 '22 at 13:02
Here is my approach, which provides a consistent way of navigating between active terminals as well as jumping between the terminal and editor panes without closing the terminal view. You can try adding this to your keybindings.json
directly but I would recommend you go through the keybinding UI (cmd+K cmd+S
on a Mac) so you can review/manage conflicts etc.
With this I can use ctrl+x <arrow direction>
to navigate to any visible editor or terminal. Once the cursor is in the terminal section you can use ctrl+x ctrl+up
or ctrl+x ctrl+down
to cycle through the active terminals.
cmd-J
is still used to hide/show the terminal pane.
{
"key": "ctrl+x right",
"command": "workbench.action.terminal.focusNextPane",
"when": "terminalFocus"
},
{
"key": "ctrl+x left",
"command": "workbench.action.terminal.focusPreviousPane",
"when": "terminalFocus"
},
{
"key": "ctrl+x ctrl+down",
"command": "workbench.action.terminal.focusNext",
"when": "terminalFocus"
},
{
"key": "ctrl+x ctrl+up",
"command": "workbench.action.terminal.focusPrevious",
"when": "terminalFocus"
},
{
"key": "ctrl+x up",
"command": "workbench.action.navigateUp"
},
{
"key": "ctrl+x down",
"command": "workbench.action.navigateDown"
},
{
"key": "ctrl+x left",
"command": "workbench.action.navigateLeft",
"when": "!terminalFocus"
},
{
"key": "ctrl+x right",
"command": "workbench.action.navigateRight",
"when": "!terminalFocus"
},

- 2,298
- 17
- 23
With the key bindings in your keybindings.json
:
CTRL+j
andCTRL+k
shift focus between editors in an editor group and terminal windows in the terimalCTRL+h
andCTRL+l
shift focus between editor groups including the terminal
(These key bindings should feel particularly natural to vim users. Others may wish to change exchange h/j/k/l
for left/down/up/right
)
// In an editor group, ctrl+j and ctrl+k jump between editor windows
{ "key": "ctrl+j", "command": "workbench.action.nextEditorInGroup" },
{ "key": "ctrl+k", "command": "workbench.action.previousEditorInGroup" },
// In the terminal, ctrl+j and ctrl+k jump between terminal windows
{
"key": "ctrl+j",
"command": "workbench.action.terminal.focusNext",
"when": "terminalFocus && terminalHasBeenCreated && !terminalEditorFocus || terminalFocus && terminalProcessSupported && !terminalEditorFocus"
},
{
"key": "ctrl+k",
"command": "workbench.action.terminal.focusPrevious",
"when": "terminalFocus && terminalHasBeenCreated && !terminalEditorFocus || terminalFocus && terminalProcessSupported && !terminalEditorFocus"
},
// In the work area, ctrl+j and ctrl+k jump between editor groups
{ "key": "ctrl+h", "command": "workbench.action.focusPreviousGroup" },
{ "key": "ctrl+l", "command": "workbench.action.focusNextGroup" },
// in the first editor group terminal, jump "back" to the terminal (if there is a terminal open)
{
"key": "ctrl+h",
"when": " terminalHasBeenCreated && terminalIsOpen && activeEditorGroupIndex == 1",
"command": "workbench.action.terminal.focus"
},
// in the last editor group terminal, jump "forward" to the terminal (if there is a terminal open)
{
"key": "ctrl+l",
"when": "terminalHasBeenCreated && terminalIsOpen && activeEditorGroupLast",
"command": "workbench.action.terminal.focus"
},
// in the terminal, jump "back" to the last editor group
{
"key": "ctrl+h",
"command": "workbench.action.focusLastEditorGroup",
"when": "terminalFocus"
},
// in the terminal, jump "forward" to the last first group
{
"key": "ctrl+l",
"command": "workbench.action.focusFirstEditorGroup",
"when": "terminalFocus"
},

- 9,756
- 2
- 49
- 64
-
I use the Vim extension, Ctrl+wj works for going down to the console, for up I use ctrl+1 – Spartan Apr 15 '22 at 03:09
My solution:
- has one key
- if there's no terminal yet: opens a terminal and focuses on it
- if the focus is on the terminal: hide the panel and switch back to editor
- if the focus is on the editor and there's a terminal: unhides the terminal pane and focuses on it
{
"key": "ctrl+shift+alt+cmd+t",
"command": "workbench.action.terminal.new",
"when": "!terminalIsOpen"
},
{
"key": "ctrl+shift+alt+cmd+t",
"command": "terminal.focus",
"when": "terminalIsOpen && !terminalFocus"
},
{
"key": "ctrl+shift+alt+cmd+t",
"command": "workbench.action.closePanel",
"when": "terminalIsOpen && terminalFocus"
}

- 8,728
- 11
- 46
- 62
-
works great thx - for me without "alt" -- but it doesn't open on "focused tree path" -- Q) any idea how to do that ? – Bruno Dec 22 '21 at 21:11
-
If you don't need the "alt" I suspect you're on a not-macOS computer. Doesn't really matter for the solution of course. The OP did not ask for opening on "focused tree path". I see two challenges with that. 1) Commands don't take arguments. 2) What is the correct path to open? Maybe look into VSCode's [predefined variables](https://code.visualstudio.com/docs/editor/variables-reference#_predefined-variables) and [the Multi-Command extension](https://marketplace.visualstudio.com/items?itemName=ryuta46.multi-command). Let me know if you get that working? – Niels Bom Dec 28 '21 at 16:34
-
I am using #macos :-) - you know I have focused some tree item which I select witch arrows - then "enter" is renaming - "cmd + arrow down" is open - but missing me that "open that path in terminal" so I can run commands for that file – Bruno Dec 29 '21 at 17:28
I did this by going to setting>Keyboard Shortcuts then in the section where it give a search bar type focus terminal and select the option. It will ask to type the combination which you want to set for this action. DO it. As for editor focus type" editor focus" in the search bar and type your desired key. IF you excellently add a key . it can be removed by going to edit jason as mentioned in above comments

- 69
- 1
- 8
control + '~' will work for toggling between the two. and '`' is just above the tab button. This shortcut only works in mac.

- 447
- 6
- 15
The shortuct changes based on the keyboard layout (QWERTY/QWERTZ/AZERTA etc.)
To find out your shortuct press Ctrl+Shift+P and go to Preferences: Keyboard Shortcuts.
From there search for View:Toggle Terminal

- 177
- 1
- 8
If you're in the terminal Ctrl+' (single quote) hides the terminal and jumps back to the code editor. Hit Ctrl+' again to open the terminal which automatically gets the focus.

- 411
- 5
- 19