1110

Does anyone know the keyboard shortcut (Mac and Linux) to switch the focus between editor and integrated terminal in Visual Studio Code?

Ken White
  • 123,280
  • 14
  • 225
  • 444
Abhijeet
  • 11,872
  • 5
  • 22
  • 24

27 Answers27

1862

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:

  1. Open the Command Palette (Ctrl+Shift+P Windows/Linux or P Mac).

  2. Type "Preferences: Open Keyboard Shortcuts (JSON)" and press Enter.

  3. 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:

Artur Barseghyan
  • 12,746
  • 4
  • 52
  • 44
wgj
  • 18,876
  • 1
  • 17
  • 26
  • 65
    By 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
  • 12
    Thanks, 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
    @wgj that is true. Will actually use your way over the default :) – Roman Nov 20 '17 at 19:55
  • 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
  • 45
    Note that these shortcuts should be pasted to the `keybindings.json` file. – pseudomarvin Mar 23 '18 at 13:44
  • 61
    Open 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
  • 2
    For 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
    For Turkish keyboard ```ctrl+oem_3``` – uzay95 Oct 25 '18 at 12:27
  • 1
    This 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
  • 1
    I 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
  • 5
    This answer is like 2 years old: VS Code people, why haven't you built this in yet? ;) – machineghost Oct 09 '19 at 17:31
  • 3
    Pressing "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
  • 1
    The 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
  • 1
    This 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
  • 1
    On 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
  • 1
    I 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
  • 1
    ctrl + 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
  • 1
    I 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
  • 1
    I 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
  • 1
    Works 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
  • For me `"ctrl+[Backquote]"` worked – kuzdogan Oct 20 '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
  • 1
    According 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
  • @user24601 It's ctrl not cmd – MatrixManAtYrService Feb 22 '23 at 15:22
  • In finnish keyboard `ctrl+\`` seems to be same as `ctrl+ö` – Quirzo Mar 01 '23 at 06:42
  • 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
613

ctrl+` : To Focus on Integrated Terminal

ctrl+1 : To Focus on Editor (If editor-2 command would be ctrl+2)

enter image description here

More Info : https://medium.com/p/21969576c09c

Rahul Shukla
  • 7,365
  • 3
  • 15
  • 26
214

Ctrl+J works; but also shows/hides the console.

cmd+J for mac

RayLoveless
  • 19,880
  • 21
  • 76
  • 94
joshua wray
  • 2,157
  • 1
  • 7
  • 4
  • 33
    Cmd+J on MacOS. – Miscreant Apr 20 '19 at 00:06
  • 3
    Not working in Ubuntu Linux 16.04 (Xenial) + VSC 1.45.0 – Aldo Bassanini May 21 '20 at 10:57
  • 2
    You 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
  • @AldoBassanini Works on Ubuntu 21.04 + VSC 1.57.0 – Joep Jun 14 '21 at 12:08
  • 2
    Did 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
79

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.

Pang
  • 9,564
  • 146
  • 81
  • 122
schmudu
  • 2,111
  • 1
  • 21
  • 30
36

As of version : 1.26.1 (linux), the shortcut is not set by default. To set the shortcut

  1. open keyboard shortcuts panel [ctrl + k , ctrl + s]
  2. Search for Focus Terminal

enter image description here

  1. Set your shortcut

For editor focus is already set by default.

enter image description here

Shubham Jain
  • 876
  • 1
  • 9
  • 17
25

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.

Pang
  • 9,564
  • 146
  • 81
  • 122
Sam Xu
  • 281
  • 3
  • 9
24

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:

  1. 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 + `).

  2. This will work with any of the Panels (Terminal, Output, Debug Console, etc).

wisbucky
  • 33,218
  • 10
  • 150
  • 101
14

Hey my steps to make this work were:

  1. ctrl + shift+ p and look for preferences: keyboard shortcuts

or you can use ctrl k + ctrl s to open it directly

  1. Look in the search box for Terminal: Focus Terminal, I set up for myself alt + T alt + T but you can select the combination that you want

  2. Look in the search box for View: Focus Active Editor Group, set up for myself alt + E alt + E but again you can select the combination that you want

That's it, I hope this help

12

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" }
Pang
  • 9,564
  • 146
  • 81
  • 122
alexriedl
  • 5,916
  • 3
  • 21
  • 17
  • 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
  • 1
    I 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
12

Try using ctrl+` to toggles the visibility of the terminal and as a result toggle the focus.

Gaurav Grover
  • 191
  • 1
  • 10
11

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"
    }
]
Pang
  • 9,564
  • 146
  • 81
  • 122
Felipe Pereira
  • 1,368
  • 16
  • 26
  • 1
    Not 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
11

Here is a way to add your own keybinding for switching focus.

  1. Open your VSCode
  2. Press Ctrl+Shift+P and search for keyboard shortcuts and hit this (Preferences: Open Keyboard shortcuts).
  3. Search for 'focus terminal' in the search panel and find this option (Terminal: Focus on Terminal View) and click on the plus icon.

enter image description here

  1. Enter the shortcut as you like which is not used and hit Enter.
  2. Go to Editor mode and try using your shortcut.
  3. Now hit Alt+Shift+T to go to the terminal.
  4. Want to go back to the editor? Just Hit Ctrl+tab

Tested on Windows 10 machine with VSCode(1.52.1)

ZingAju
  • 148
  • 2
  • 13
8

The answer by Shubham Jain is the best option now using the inbuilt keyboard shortcuts.

I mapped enter image description here

to Ctrl + ;

and remapped enter image description here

to Ctrl + L

This way you can have move focus between terminal and editor, and toggle terminal all in close proximity.

Misha Akopov
  • 12,241
  • 27
  • 68
  • 82
jim
  • 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
8

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
Maksym Dudyk
  • 1,082
  • 14
  • 16
7

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.
JStrahl
  • 444
  • 1
  • 8
  • 18
  • 1
    Thank 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
6

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"
  },
Pang
  • 9,564
  • 146
  • 81
  • 122
robertovg
  • 1,018
  • 11
  • 16
5

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.

Naman Jain
  • 195
  • 2
  • 15
4

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"
}
Pang
  • 9,564
  • 146
  • 81
  • 122
Taktech
  • 455
  • 1
  • 8
  • 18
4

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"
}
]

enter image description here

S.N
  • 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
3

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"
    },
totalhack
  • 2,298
  • 17
  • 23
3

With the key bindings in your keybindings.json:

  • CTRL+j and CTRL+k shift focus between editors in an editor group and terminal windows in the terimal
  • CTRL+h and CTRL+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"
},
Jthorpe
  • 9,756
  • 2
  • 49
  • 64
2

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"
  }
Niels Bom
  • 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
0

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

Mahad Ali
  • 69
  • 1
  • 8
0

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

surender pal
  • 447
  • 6
  • 15
0

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

final result

LazerDance
  • 177
  • 1
  • 8
0

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.

michal krzych
  • 411
  • 5
  • 19
-1

ctrl + - also works, it means to go back previous cursor position

1da
  • 37
  • 4