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

Any plans to support Ctrl+C on Windows? #1753

Closed
danieldaeschle opened this issue Jan 3, 2020 · 8 comments · Fixed by #1808
Closed

Any plans to support Ctrl+C on Windows? #1753

danieldaeschle opened this issue Jan 3, 2020 · 8 comments · Fixed by #1808

Comments

@danieldaeschle
Copy link

No description provided.

@ahopkins
Copy link
Member

ahopkins commented Jan 9, 2020

I will be the first to admit that I am not aware of what would be involved to add this signal. 😬

Any one that is more versed in Windows want to chime in?

@ahopkins
Copy link
Member

ahopkins commented Jan 9, 2020

With a couple minutes of Google.... https://stackoverflow.com/a/52941752

@danieldaeschle
Copy link
Author

Using windows api like in the example looks like a nice solution.

@ahopkins
Copy link
Member

ahopkins commented Jan 9, 2020

@danieldaeschle does CTRL-Break work?

@danieldaeschle
Copy link
Author

danieldaeschle commented Jan 9, 2020 via email

@seemethere
Copy link
Member

I don't really feel like adding this functionality into sanic core would be greatly beneficial when there are already widely known alternatives.

Especially when the code solution to this is adding in a special case just for windows.

@Tronic
Copy link
Member

Tronic commented Jan 10, 2020

I had planned to fix this but recently I don't have much time to work on Sanic at all. The problem might be that of terminating the worker processes, so it might already be resolved if you don't use workers or autoreload, and if that is the case, the thing needing implementation is better killing logic (because Windows doesn't have proper signals), e.g. closing child process stdin from parent.

@danieldaeschle
Copy link
Author

danieldaeschle commented Jan 15, 2020

@ahopkins I just tested Ctrl+Break. I doesn't work. Neither with 4 workers, nor with one worker.

In IDEs like PyCharm that isn't that bad. But in editors like vscode where you're using the terminal, you have to kill that terminal and create a new one every time.

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

Successfully merging a pull request may close this issue.

4 participants