Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keyboard interrupt no longer stops the command line debugger #19775

Open
Tracked by #51393
Zylann opened this issue Jun 26, 2018 · 12 comments
Open
Tracked by #51393

Keyboard interrupt no longer stops the command line debugger #19775

Zylann opened this issue Jun 26, 2018 · 12 comments

Comments

@Zylann
Copy link
Contributor

Zylann commented Jun 26, 2018

Godot master ff01fd5
Windows 10 64 bits
Powershell

In Godot 3.0.4, I used to debug my plugin by using the command line debugger (-e -d command line options), and using Ctrl+C (keyboard interrupt) to break out of a script error and close Godot straight away. This was fast and also left the terminal open, allowing me to keep track of the logs and easily restart the session without retyping commands.

Now I wanted to debug it using a build I made from master, but I noticed keyboard interruption no longer stops the process. Instead, the debugger just repeats the error. I tried using q for quitting, but it didn't quit and stayed blocked on the last script error, so the only way I could close was to close the terminal...

@robojumper
Copy link
Contributor

robojumper commented Jun 26, 2018

git bisect yields c45f44d as the offending commit, though q or quit do work there (edit: q/quit also work on master 80d6882 for me).

@akien-mga
Copy link
Member

CC @bfloch

@akien-mga
Copy link
Member

(Tagging as "bug" for now, but it might actually be a feature as per c45f44d, so will retag accordingly once we know more about it.)

@Zylann
Copy link
Contributor Author

Zylann commented Jun 26, 2018

I'd really like Ctrl+C to behave as it was, or at least have a console shortcut to do the same. q doesn't work for me because it just retriggers the error and what I want is kill Godot from the same command line.

@bfloch
Copy link
Contributor

bfloch commented Jun 27, 2018

Hi Zylann,

Sorry to head q/quit does not exit Godot in some cases.
This seems to be the bug here, I did not have a windows machine to test back then.

As the the CTRL-C: It behaves as gdb or similar debuggers.

I can not think of a different way to break into the debugger from a running application.
If you can provide and alternative to using interrupt signals we can look into it.

@Zylann
Copy link
Contributor Author

Zylann commented Jun 27, 2018

On the Windows command line, Ctrl+C was pretty much the default for interrupting a process, since it worked not just for Godot but anything else I launch from a command. I thought Godot commands were supposed to be typed, not react to things like Ctrl+*.

If Godot cannot support this anymore, I would just like an alternative that does the same thing (kill the process, exit(0), or clean exit if that's even possible), because it's very annoying and slows me down. If the q command is bugged then it should be fixed. If there isn't a way, then maybe changing Ctrl+C wasn't a good choice, especially since the continue/c command was available already (unless I misunderstand what it does?)... unfortunately I'm not experimented enough to provide an alternative :/

@bitwes
Copy link

bitwes commented Mar 16, 2019

I can confirm this issue with 3.1 stable on Mac through iTerm when in bash or zsh. You have to right click and "force quit" as ctrl+c, q, quit have no effect. Given that I run my unit tests through the command line 99% of the time this can get annoying. It has been especially troublesome when trying to convert my project to 3.1 by running unit tests and waiting for errors.

@bfloch
Copy link
Contributor

bfloch commented Mar 19, 2019

I think this issue describes two problems:

  1. Some people seem to not like the interrupt into the debugger (usability issue)
  2. q/quit in console debugger does not work on Windows or Mac (bug)

To fix 1. we could add an additional debug options to turn this behaviour on (opt-in), which would probably meet peoples expectations for CTRL-C. It can not be implemented otherwise since the SIGINT (like) comes from the platform, if I am not mistaken.

  1. Seems to be a platform dependent issue. I hope someone can help here since I do not have a dev environment for Windows and got no Mac hardware.

@bitwes
Copy link

bitwes commented Apr 9, 2019

Simple bash method to work around the problem in the meantime. It will kill a backgrounded process if it is the only one. When godot "hangs" press ctrl+z then type kil and no more godot.

https://gist.github.com/bitwes/e9cdc95bea57e7b7db6b2ba166902c93

@akien-mga akien-mga modified the milestones: 3.2, 4.0 Dec 13, 2019
@KoBeWi
Copy link
Member

KoBeWi commented Nov 21, 2020

Can anyone still reproduce this bug in Godot 3.2.3 or any later release?

@Zylann
Copy link
Contributor Author

Zylann commented Nov 21, 2020

It still happens in 3.2.3.

@lihop
Copy link

lihop commented Jul 4, 2021

On Linux with Godot 3.3.2 and I have a similar but, closely related issue.
Ctrl+C not exiting the debugger is not too much of a problem. This behavior is consistent with bash, python, node and gdb and probably many other shells/repls.
2021-07-05-044001_574x361_scrot
In the screenshot above Ctrl+C prints ^C in bash or KeyboardInterrupt in python, followed by a new prompt.
To exit bash, python and other repls I usually use Ctrl+D which sends the end of transmission (EOT) character.

However, when I type this at the Godot debugger prompt it results in an infinite loop.
I have created a new issue for this here #50170

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants