Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pycharm: How to focus on Editor when hit a debug point

Tags:

python

pycharm

I am using a mac, with Pycharm version 2018.2.4 Community version.

When I run a debugging session using the debugger and hit a debug point, I have to click on my editor using my mouse to be able to type code on the editor. If I don't do this and hit my keyboard directly, Mac will complain with some "bing" sound, signaling the keyboard input is not valid to any application (my opinion).

How to make my Pycharm auto focus on the editor when hitting the debug point? Or at least focus on the debugger so that I can hit ESC to focus on the editor?

I have selected "Focus application on breakpoint" in the setting. enter image description here

like image 865
Lisa Avatar asked Feb 09 '19 16:02

Lisa


People also ask

How do I enable debugging actions in PyCharm?

Just right-click any line in the editor and select the Debug <filename> command from the context menu. After the program has been suspended, use the debugger to get the information about the state of the program and how it changes during running.

How do I use the debugging tool in PyCharm?

By default, the Debug tool window opens when your program hits a breakpoint and is not hidden when the session is terminated. To change this behavior, clear the Show debug window on breakpoint checkbox on the Build, Execution, Deployment | Debugger page of the IDE settings Ctrl+Alt+S .


1 Answers

This is how it should work:

In Preferences, type Focus application on breakpoint into the search bar and be sure it is toggled on.

Apply that setting and exit Preferences.

In your debugger, when you hit a breakpoint, hit the escape key, and your cursor should be blinking in your editor.

For me, I had to disable the setting, apply, re-enable the setting and re-apply once more.

It now behaves as stated above.

like image 55
Chris Larson Avatar answered Sep 28 '22 09:09

Chris Larson