Toggle focus between terminal and chat input

Hello. I’d like to toggle from chat input to terminal focus. I know that you do cmd+L to focus onto chat. See the image of where I expect to begin focusing from.

What is the keybinding that conditions when the text input is focused? I tried the below and it did not work:

{
“key”: “cmd+m”,
“command”: “workbench.action.terminal.focus”,
“when”: “!terminalFocus && inChatInput”
},

Hey, to focus on the terminal, use the shortcut Ctrl + `. If you need to move the focus to the editor, use the shortcut CMD + 1. Hope this helps!

Thanks alot! That was it.

1 Like

It used to be that when hiding the terminal panel with either Ctrl + ` or Ctrl + j the focus would be brought back to the editor automatically but that is no longer the case.

Is there a way to enable that feature via settings ?

I feel this is a much better approach (single command) vs having to hide the panel + manually focus on editor with Ctrl + 1 (two commands)

1 Like

I was in the middle of writing up a standalone bug report for this, and then realized it’s because I was in the new “Agent Layout” without realizing it. Switching back to the normal layout (Cmd + E) returned the behavior I was used to (focus returns to editor after closing Terminal).

Looks like Cursor might have intentionally changed the behavior to auto-focus the AI sidebar when in Agent Layout, maybe cause that’s supposed to be the “home base” so to speak.

Anyway, that might be what’s going on for you too @caike ?

1 Like

That was it! Thank you @alythobani

1 Like