Reload/restart: restore terminal state
When hypercorn restarts itself (via
SIGHUP from !29), it uses
os.execv, which replaces the current process, and therefore does not allow pdb++ (or rather pyrepl used by it) to restore the terminal state (set via
This might cause
Ctrl-C to not work anymore then etc.
This might only related to pdb++/pdbpp then running in another thread - would have to investigate there.
I think hypercorn should store the initial terminal state and restore it when reloading/restarting its own process.
But it looks like this would need to be done then twice for asyncio and trio then twice in
Is there a better way?
Could the lifespan protocol be used for this?