CTRL-BREAK still make sense on Windows for `runserver`?

1,621 views
Skip to first unread message

wi...@wsvincent.com

unread,
Jun 21, 2021, 4:10:01 PM6/21/21
to Django developers (Contributions to Django itself)
Hi all,

Is the Pause/Break key still a thing on Windows keyboards? My new Surface 4 doesn't even have such a key and I think this applies to many new Windows keyboards as well.

I ask because the runserver.py command currently has `CTRL-BREAK` if Windows32 or `CONTROL-C` for everything else, like Mac/Linux. Seems this could be just standardized to `CONTROL-C` no?

-Will

Matthew Pava

unread,
Jun 21, 2021, 4:40:36 PM6/21/21
to django-d...@googlegroups.com

Ctrl + Break and Ctrl + C are treated slightly differently by Windows. Ctrl + Break is always a signal, but an application can override the functionality of Ctrl + C.

 

Please see https://docs.microsoft.com/en-us/windows/console/ctrl-c-and-ctrl-break-signals

 

I’ve dealt with this issue many times in the past (in other applications) in which I tried Ctrl + C but got nowhere. As such, I prefer the current behavior.

 

Your Surface 4 keyboard simply doesn’t have a Break or Pause key. Either try getting another keyboard, use the Pause on the on screen keyboard, use a 3rd party utility to map the keystroke, or just use Ctrl + C. Many people have complained about this issue, but I don’t consider it a Django issue.

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/ee88cce3-3f7e-4ca8-b2af-e1bc4b1fe8c4n%40googlegroups.com.

Adam Johnson

unread,
Jun 21, 2021, 5:53:15 PM6/21/21
to django-d...@googlegroups.com
Would it be bad to have Django respond to both shortcuts?

Carlton Gibson

unread,
Jun 22, 2021, 1:58:47 AM6/22/21
to Django developers (Contributions to Django itself)
I too realise I don't have a(n obvious) break key but have been happily hitting CTRL-C. 

On Monday, 21 June 2021 at 23:53:15 UTC+2 Adam Johnson wrote:
Would it be bad to have Django respond to both shortcuts?

I think as a matter of fact it does. At least using PowerShell/Win10/Etc — Looking at Matthew's link, we don't do either of the things that would inhibit this. 🤔

Looking at it from Will's POV (writing introductory guides) the output text of runserver might be a bit problematic:

"Quit the sever with CTRL-BREAK" — Errrmmm... Where's that then? 


Florian Apolloner

unread,
Jun 22, 2021, 6:02:39 AM6/22/21
to Django developers (Contributions to Django itself)
As long as runserver (usually) properly shuts down when CTRL-C is hit, then it imo makes sense to change the text -- especially if that is the only thing accessible on some keyboards.

The usually above is because someone might have a bare except that is hit that moment and as such the process might not shut down.

William Vincent

unread,
Jun 22, 2021, 2:31:17 PM6/22/21
to Django developers (Contributions to Django itself)
Ok, thanks for the link Matthew. Just thought I'd bring it up in case things had changed. Seems status quo is fine for now but if Windows keyboards continue to remove the Pause/Break key might make sense to add `Control-C` as Adam notes or eventually switch over.
Reply all
Reply to author
Forward
0 new messages