Shortcut to switch between editor and terminal?

I like to leave my terminal on while coding, and find myself clicking between editor and terminal window a lot.

Is there a shortcut to switch focus between the 2 (editor and a tool window)?

7 comments

Hi there,

Well ... Alt+F12 is a shortcut to open/hide Terminal panel (check "View | Tool Widows | Terminal" to see actual shortcut that you may have on your computer; it can be changed in "Settings/Preferences | Keymap")

Unfortunately that shortcut will hide Terminal when invoked fro the second time (inside the Terminal, e.g. to move from Terminal to the Editor -- standard behaviour for other tool windows as well).

Possible solution: disable "Override IDE Shortcuts" option in "Settings/Preferences | Tools | Terminal" (https://youtrack.jetbrains.com/issue/IDEA-116221) -- this will allow to use standard Esc to move focus back to the Editor (works from any tool window).

Other than that: https://youtrack.jetbrains.com/issue/IDEA-116865 (to be able to assign another shortcut to focus the Editor instead of rather hardcoded Esc)

5

Cool. I think that would work for me.
So I guess I should make a feature request if I want a shortcut that toggles between editor and terminal?

I think it's a frequently used feature. 

Just that I'd been relying on an external terminal before, but only recently decided to reduce dependency on other apps.

1

>So I guess I should make a feature request if I want a shortcut that toggles between editor and terminal?

It's up to you.

But most likely you will get similar answer to what I have suggested. I have big doubts that devs will introduce special shortcut just for navigating to and from specific window.

1

It is not really from and to a specific window. Is to the editor (like the most important window!). You can't consider ESC as a keybind as it is broken for the terminal.

2

@Andybergon

>it is broken for the terminal

It's not "broken" -- it's more of a "conflict of the interests" -- some people (possibly majority) want Esc to always switch to the Editor .. but some want to still be able to actually press it in the Terminal (as some programs do have a use for it).

As mentioned in the first comment -- you can tell IDE to pass all keys to IDE first ("Override IDE Shortcuts" option) so Esc will work as desired (will take focus there) but then it will stop working in actual Terminal...

Let's hope that devs will implement more dedicated action that would allow to bind other shortcut than Esc for those who want to have Esc to keep working in Terminal and have some another shortcut for switching into the Editor (tickets to watch after/vote/comment are in my first comment).

4

Wish they would address this in https://intellij-support.jetbrains.com/hc/en-us/community/posts/206375799-Keyboard-Shortcut-Focus-on-Editor?page=1#community_comment_115000519244.

For now I have to change my focus to one of the sidebars and then hit escape. Not the most ideal flow. I was considering switching to vsCode the other day partially related to this. 

1

I use Ctrl + Tab (this is on Linux)


From editor:

Ctrl + Tab, (still holiding Ctrl) T

From terminal:

Ctrl + Tab, (optional: keep holding Ctrl and navigate between editor panes with arrow keys)

2

Please sign in to leave a comment.