dpo / atom-python-debugger

IDE-like Python debugger for Atom
MIT License
42 stars 13 forks source link

UI: stay on the 'Enter debugger command here' prompt #34

Closed jerabaul29 closed 6 years ago

jerabaul29 commented 6 years ago

When using the command prompt of the package GUI, the cursor gets back to the file each time I press enter. For example, my workflow is:

Is there a workaround? Otherwise, could you update the package / add a settings option to enable the cursor to stay in the debugger command line field?

I really like o see the source code in my Atom window compared with using pdb in command line in terminal or other GUI, but I would like to still be able to use the pdb command line as if it were a usual terminal.

jerabaul29 commented 6 years ago

PS: it is a bit funny, while "n [enter]" has the 'out-of-focus' problem I mentioned, the "print some_variable [enter]" command does not: in the case of using the print command, the pdb command line stays into focus.

dpo commented 6 years ago

Thanks for the report. I'll look into it.

dpo commented 6 years ago

print doesn't change the focus because it doesn't cause any change in the editor window. On the other hand, n moves the highlighted line in the editor window, and that's where the focus goes. I'll look into how to not loose focus but for the time being I recommend using the step button instead of entering n in the debugger command panel. The effect is the same.

jerabaul29 commented 6 years ago

Ok, I understand.

I am aware of the next and step buttons, but I think it is faster to do it by command line entering n. Thank you for taking a look at this!

dpo commented 6 years ago

Check out the panels branch and give it a spin. Let me know if that fixes it for you.

jerabaul29 commented 6 years ago

Installed from Git, using the panels branch:

rm -rf atom-python-debugger/
git clone -b panels https://github.com/dpo/atom-python-debugger.git
cd atom-python-debugger/
apm install
apm link

it works perfectly on my machine, this is great, thank you :)

new_atom-python-debugger

jerabaul29 commented 6 years ago

Update: it looks like there is a bug with the run / stop button:

example_cannot_relaunch.ogv.tar.gz

jerabaul29 commented 6 years ago

But maybe I am using your UI wrong? I think it used to work like that though? Btw, maybe calling your button start instead of run would be more intuitive if it actually should be used to start the debugger? Maybe also putting a few lines about the use on the Readme, like wich pdb command each button issues, would be helpful?

dpo commented 6 years ago

That has changed very recently. Clicking stop now clears the name of the file being debugged. Perhaps it’s not ideal but it avoids surprising side effects mentioned in other issues.

jerabaul29 commented 6 years ago

Ok. How to restart pdb then? I guess one then needs to give the full command in the enter input arguments here field?

Maybe it could be nice if the run button automatically starts pdb on the file that is currently active? I think it is helpful that the run button works after the stop one also, but no problem if you want to do in another way.

dpo commented 6 years ago

If you click click continue instead of stop, the script should restart from the beginning. Or you can again enter e=/path/to/file.py in the debugger command field. I agree it's not ideal and ideas are welcome. Setting the file to the current file isn't necessarily what you want though (you may be setting breakpoints in an auxiliary file which isn't the main entry point).

jerabaul29 commented 6 years ago

Ok. It is a bit unconvenient as it looks like the path may be quite long, and is is a big unclear if it should be absolute, or relative to where Atom is opened.

Do you think it would be possible to add a start on active file button?

Anyway, it would be nice to have a description in the readme of what each button performs.

dpo commented 6 years ago

I agree, sorry about that. The package is still in movement.