Closed andygill closed 9 years ago
% stty sane
fixes the bad abort.
We need to re-think this. We want to support
abort
the ghci shell, and the server.resume
the compiler, quits the ghci shell.HERMIT> abort
aborts the ghci shell, and aborts the compiler.HERMIT> resume
resumes the compiler, quits the ghci shell.Making the GHCi shell quit is turning out to be quite hard. Perhaps we should consider :abort
and :resume
?
What would :abort
and :resume
buy us that the existing methods don't? Aren't user defined ghci commands just aliases to existing methods, or are you considering extending ghci internally?
It would be extremely helpful if we had some notion of the hierarchy of all of these processes and where the propagation of the exit exception stops.
Because :abort can both tell the server to shut down, and the tell GHCi shell to quit. I can't see how to stop GHCi from inside a running Haskell program, in a way that restores the stty properties.
I think I'm still not clear on what is shutting down correctly and what isn't.
If it's just the GHCi shell that we spawn in the server
callback method, would it help to turn off delegation of SIGINT for the process, not use waitForProcess
, and instead manually catch and propagate exit exceptions to control the shutdown behavior?
The exit exception does not propagate to the main ghc thread, unfortunately. I think I have a prototype working, checkin shortly.
Added :resume
and :abort
.
Or you can use the longhand version, which does the same thing.
HERMIT>resume
HERMIT>^D
Note that ExitSuccess does not quit the ghci session.