Opened 6 years ago
Last modified 4 years ago
#30416 assigned Bug
Runserver's reloading mechanism should restore terminal state completely — at Version 1
Reported by: | Daniel Hahler | Owned by: | nobody |
---|---|---|---|
Component: | Core (Management commands) | Version: | 2.2 |
Severity: | Normal | Keywords: | |
Cc: | Tom Forbes | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | yes | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
Currently it only ensures that echo is on, but not that e.g. Ctrl-C works etc.
This can be triggered when using pdb++, which uses pyrepl itself: it puts the terminal into raw state.
If the reloader then kicks in while at the prompt this will not be restored (except for echo).
Related issue, which mentions that a better mechanism would be good: https://code.djangoproject.com/ticket/15880
btw: pyrepl has no chance to restore itself: listening to SIGTERM is not possible in threads apparently, and e.g. atexit
is also not triggered there.