Vscode: terminal focus key binding is not working correctly after update to 1.5

Created on 8 Sep 2016  Â·  16Comments  Â·  Source: microsoft/vscode

  • VSCode Version: 1.5
  • OS Version: windows 10

Steps to Reproduce:



    1. 2.
bug important integrated-terminal verified

Most helpful comment

@roblourens @ivarref workbench.action.focusActiveEditorGroup is a thing now (#11904), so you can use this to reliably focus the most recently used file/editor:

{ "key": "ctrl+`",          "command": "workbench.action.terminal.focus",
                            "when": "!terminalFocus" },
{ "key": "ctrl+`",          "command": "workbench.action.focusActiveEditorGroup",
                            "when": "terminalFocus" }

All 16 comments

@pritimay Do you mean the terminal focus ley binding was working for you in 1.4 but is not working after update to 1.5 ?

Yeah, just after update from 1.4 to 1.5 it is not working

@pritimay Can you paste in your settings.json and keybindings.json?

I'm seeing the same problem. Below is keybindings.json. My settings.json is empty.

// Place your key bindings in this file to overwrite the defaults
[{
    "key": "cmd+`",
    "command": "workbench.action.terminal.focus",
    "when": "editorTextFocus"
}]

(also, if there is an easier way to toggle between the terminal and the editor without a custom keyboard, I'd love to know it! just started trying out VSCode earlier this week, so apologize if thats a dumb question!)

@Tyriar This are my user settings.json and keybindings.json

{
"terminal.integrated.cursorBlinking": true,
"files.autoSave": "afterDelay",
"files.autoSaveDelay": 1000,
"window.restoreFullscreen": true
}

[
{
"key": "ctrl+q",
"command": "workbench.action.terminal.focus",
"when": "!terminalFocus"
},

{
"key": "ctrl+shift+x",
"command": "extension.partialDiff.markSection1",
"when": "editorTextFocus"
},
{
"key": "ctrl+d",
"command": "extension.partialDiff.markSection2AndTakeDiff",
"when": "editorTextFocus"
}
]

workbench.action.terminal.focus is working only after killing the terminal.

Can confirm the same issue. I tried this on a clean install. Both settings.json and keybindings.json are empty.

Comfirm this issue, too.
try this simple setting which works in 1.4, but not 1.5.1:

{ "key": "ctrl+alt+t", "command": "workbench.action.terminal.focus"}

You can also reproduce this issue with: ctrl-shift-p and select Terminal: Focus Terminal
My keybindings.json is an empty array.
VS Code then won't focus the terminal in 1.5.1.

@apbendi It's not a dumb question. I think it would be an excellent feature to easily toggle between terminal and editor without a custom keyboard shortcut. I don't know of a way at present moment.

PS @apbendi I'm using this config in VS Code 1.4 to focus text editor / terminal with the same shortcut:

// Place your key bindings in this file to overwrite the defaults
[
    {
        "key": "ctrl+`",
        "command": "workbench.action.terminal.focus",
        "when": "!terminalFocus"
    },
    {
        "key": "ctrl+`",
        "command": "workbench.action.openLastEditorInGroup",
        "when": "terminalFocus"
    }
]

Thanks all for the reports, fixed this in master and I'll mark this to be included in the upcoming translation build.

Thanks @Tyriar really needed it

Also I love your setup @ivarref, I might have to steal it once the fix lands :smile:

I like that toggle setup too. You can always collapse the bottom pane with cmd+j so you don't even need to replace the toggleTerminal binding to hide it.

Added it to my settings with a small tweak:

{ "key": "ctrl+`",          "command": "workbench.action.terminal.focus",
                            "when": "!terminalFocus" },
{ "key": "ctrl+`",          "command": "workbench.action.focusFirstEditorGroup",
                            "when": "terminalFocus" }

I created #11897 requesting to add a command that focuses the most recently used editor group so it feels better.

@roblourens @ivarref workbench.action.focusActiveEditorGroup is a thing now (#11904), so you can use this to reliably focus the most recently used file/editor:

{ "key": "ctrl+`",          "command": "workbench.action.terminal.focus",
                            "when": "!terminalFocus" },
{ "key": "ctrl+`",          "command": "workbench.action.focusActiveEditorGroup",
                            "when": "terminalFocus" }
Was this page helpful?
0 / 5 - 0 ratings