Manish Goel
Manish Goel

Reputation: 893

How to move caret to console in pycharm?

Is it possible to have a keyboard shortcut to move the caret from editor to console and back in pycharm? I can switch the focus between editor and console using CTRL+TAB, but that doesn't allow me to start typing in the console unless I click in it.

I am using the linux community distribution.

Upvotes: 2

Views: 1545

Answers (5)

IF.Francisco.ME
IF.Francisco.ME

Reputation: 146

A couple of years later but i found my self in this situations, i believe the other answers are good enough for some but they lack some important information or at least i didn't found it.

You need to look for the term Python or debug console under tools if you want to focus to the console with the caret at it, add a keymap value for that (in my case i added ALT+2), do NOT use the python console under tool windows, for that it will focus on the python console but not the caret at it.

(done with pycharm 2020.1.1 in a ubuntu 20.04 lts machine)

focus caret on python console pycharm

pycharm professional edition 2020.1.1

Upvotes: 0

Alex Petralia
Alex Petralia

Reputation: 1770

The key is to hit the TAB key once (potentially twice) after you move into the Python Console (via whatever shortcut you specify in the keymap).

Upvotes: 1

cerebrou
cerebrou

Reputation: 5550

You can use Alt + 4 or Alt + 5 where the digit is the window number. And then to refocus back to the edit you press Enter.

Upvotes: 0

flow2k
flow2k

Reputation: 4357

I think it also depends on whether the Python Console is docked - looks like it doesn't work if the Console is in another Window. So my current setup is having the Console docked:

enter image description here

Upvotes: 0

dmitrybelyakov
dmitrybelyakov

Reputation: 3864

I'm on MacOS and PyCharm 2018.2. Doing Ctrl+Tab+P opens up console and focuses on it so I can immediately start typing.

Update: You can also set your own key map: Tool Windows/Python Console. Hitting Esc will focus you back on the editor window.

Upvotes: 1

Related Questions