Switch focus between editor and integrated terminal in Visual Studio Code

前端 未结 16 1629
我寻月下人不归
我寻月下人不归 2020-12-04 04:07

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

相关标签:
16条回答
  • 2020-12-04 04:58

    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.
    0 讨论(0)
  • 2020-12-04 05:07

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

    0 讨论(0)
  • 2020-12-04 05:07

    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"
    }
    
    0 讨论(0)
  • 2020-12-04 05:09

    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

    1. Set your shortcut

    For editor focus is already set by default.

    0 讨论(0)
提交回复
热议问题