Currently all the panel toggle commands hide the respective panel when it's visible and show it when it's hidden. I find this annoying though and instead use the following custom keybinding:
{
"key": "ctrl+`",
"command": "workbench.action.terminal.focus",
"when": "!terminalFocus"
}
This overrides the setting when the terminal does not have focus to simply focus it, but retain the hide behavior when it is focused. This means you don't have to hit ctrl+` twice in order to get focus to the terminal when it's already displayed but not focused. This does change the hiding the terminal case when it's not focused to need 2 ctrl+`'s but personally I hardly ever do this compared to switching focus from the editor to the terminal.
I frequently tell users about my config and they all react positively so I'm wondering whether we should make this the default behavior for all panels (to keep them consistent).
/discuss
I believe this should be the default behavior because it aligns with user intent: no matter where I'm at in the editor, if I hit the hotkey it should bring me to the respective panel. If I'm already there I probably want to toggle it.
I am ok changing this, the sidebar behaves the same (focus in when not focussed and invoking the keybinding). As long as we provide a way to configure the old behaviour.
Should be changed, yes. I'm using almost exclusively using workbench.action.focusPanel as soon as the terminal is active because I can't stand the do-2-things-at-once-behaviour of workbench.action.terminal.focus.
Consistency with the sidebar would be a big plus 馃憤
I am fine with changing this to behave like the sidebar. Especially if the users seem to prefer this. They can always use cmd + J to toggle
This was brought up already before - https://github.com/Microsoft/vscode/issues/7540
+1 for the change.
I cannot emphasize how many times I have had to invoke the shortcut twice solely to regain focus on the terminal. Definitely a usability flaw
@isidorn to be clear I'm proposing a conditional focus though so it would not be consistent with the sidebar, just a little more like the sidebar's behavior.
Personally, i would just like to switch cursor between terminal and editor without hiding terminal. This setting works for me.
'{
"key": "ctrl+`",
"command": "workbench.action.terminal.focus",
"when": "!terminalFocus"
},
{
"key": "ctrl+`",
"command": "workbench.action.focusActiveEditorGroup",
"when": "terminalFocus"
}'
This keybinding works in v1.15.0 ctrl+Alt+'
However, it's one of the most awkward key combinations ever!
@dbaeumer @isidorn @sandy081 this is currently blocked on when context clauses for output, problems and tasks which I don't think exist currently https://code.visualstudio.com/docs/getstarted/keybindings#_when-clause-contexts
I'd be happy to make the keybinding changes after the contexts are implemented.
@Tyriar Is there an issue tracking the when context clause change that blocks this?
Problems panel supports following commands to toggle and focus
workbench.actions.view.problems - Toggle problems panelworkbench.action.problems.focus - Focus problems panelPlease make this the default behavior! The custom keybinding definitely improves usability.
Just wanted to mention this alternative, for those who are ok with having two sets of keybindings:
{
"key": "ctrl+shift+`",
"command": "workbench.action.terminal.toggleTerminal"
},
{
"key": "ctrl+`",
"command": "workbench.action.terminal.focus",
"when": "!terminalFocus"
},
{
"key": "ctrl+`",
"command": "workbench.action.focusActiveEditorGroup",
"when": "terminalFocus"
},
It does the following:
ctrl+shift+` will always toggle the terminalctrl+` will toggle the terminal when it is untoggledctrl+` will focus the terminal when it toggled but not focusedctrl+` will focus the editor when the terminal is toggled but not focusedIs there already a way to show a pannel without focusing it? If this isn't related to this issue i'll open a new one.
@Tyriar for my understanding: you are suggesting to change our various keybindings for panel items to move focus in and out instead of hide & show right? When I look at how our keybindings for the side bar behave, it seems there we do exactly that (focus in and focus out). Given that I think being consistent would be good. Though there is https://github.com/Microsoft/vscode/issues/48545 which asks for changing our viewlet keybindings to actually show & hide.
@bpasero I'm suggesting not quite how the viewlet behaves:
Ok thanks for clarifying. I think we changed this behaviour we should also change it for the sidebar.
I think my last statement was not good now that I see where these commands are used: we reference them from the main menu (under the "View" menu) and so potentially clicking there can mean to hide the panel because the panel was already visible.
I think we should at least be consistent and do the same as the sidebar:
I am not sure what the history behind these commands that they would hide the panel (@isidorn ?) but the current behaviour is weird and lead us to duplicate certain commands, such as:

Thoughts?
@bpasero I'm not suggesting adding another command, rather adding new default keybindings:
{
"key": "ctrl+`",
"command": "workbench.action.terminal.focus",
"when": "!terminalFocus"
},
{
"key": "shift+ctrl+m",
"command": "workbench.action.problems.focus",
"when": "!problemsFocus"
},
...
When the panel is open and focused: It should focus the editor (so you can jump in and out)
This doesn't really solve the problem though imo, I use ctrl/cmd+1 when I want to switch back to the editor personally. The above keybindings just makes it nicer to work with the terminal such that you don't need to trigger toggle terminal twice if it's already visible. I often recommend people use this setup for toggle terminal and I've only heard positive feedback.
@Tyriar I still dislike the fact that viewlets behave differently from panels
@Tyriar I have a change ready in https://github.com/Microsoft/vscode/commit/c7b740fa17953cb84002f36f79d0ec4f42136972 that would change every panel toggle action to behave as outlined in https://github.com/Microsoft/vscode/issues/19400#issuecomment-421038167. I do not think we can just fix this via changing our default keybindings, because what about people that have changed the keybindings manually?
@bpasero looks ok, one thing to keep in mind is that doing it this way makes you unable to hide the panels via the command palette. You can still use "toggle panel", but "toggle terminal" will actually focus the terminal since the command palette was focused.
Good point, I suggest we talk about this in the UX call.
The behaviour of the commands for toggling panels has changed as outlined in https://github.com/Microsoft/vscode/issues/19400#issuecomment-421038167. To get back the previous behaviour, simply configure a keybinding to close the panel when the related panel is active, e.g. for output:
{
"key": "cmd+shift+u",
"command": "workbench.action.closePanel",
"when": "activePanel==workbench.panel.output"
}
The list of panel identifiers is:
workbench.panel.terminalworkbench.panel.markersworkbench.panel.outputworkbench.panel.replVerification: see https://github.com/Microsoft/vscode/issues/19400#issuecomment-421038167
@bpasero I think you took @Tyriar comment a bit too literarly. I verified it works great, however there is one corner case which is a regression, thus reopening
Wow, not sure how I did not test that. Fixed, thanks!
I found the link to this issue in release notes for the 1.28.2 release and I like the way how ctrl + ` behaves now. I also was annoyed by the fact that I have to type terminal shortcut twice if I want to move back to the terminal.
But what shortcut can I use to move back from the terminal to an editor? I mean, I don't want to close a terminal panel. I want to leave it open and switch focus to an editor. A use case for this would be the following: I will write in the editor a code that depends on the result of a teminal command that I just run. So I want to move focus from terminal to an editor and leave terminal open.
@plagov just add a custom shortcut to this command

@plagov try Ctrl+P Esc
Most helpful comment
Personally, i would just like to switch cursor between terminal and editor without hiding terminal. This setting works for me.
'{
"key": "ctrl+`",
"command": "workbench.action.terminal.focus",
"when": "!terminalFocus"
},
{
"key": "ctrl+`",
"command": "workbench.action.focusActiveEditorGroup",
"when": "terminalFocus"
}'