-
Notifications
You must be signed in to change notification settings - Fork 272
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
ucm
shell should cancel input at ctrl+c
and quit at ctrl+d
#872
Comments
Something I've noticed is that Ctrl+C works to cancel evaluation and exit back to Possibly relevant: http://neilmitchell.blogspot.com/2015/05/handling-control-c-in-haskell.html Note: we are using unison/parser-typechecker/src/Unison/Runtime/Rt1IO.hs Lines 473 to 475 in 95c9673
I would have thought that would reliably catch signal-based async exceptions too, but maybe not. Would love help from someone in tracking this one down, and then once we figure out how to do this trapping reliably we can do the same inside the main loop, even when not evaluating. Also, I notice that GHCi does this properly so that might be a place we could look at to see what it's doing. |
I'm planning on taking a look at this! |
Looks like I can confirm the behavior you're noticing where a first ctrl c cancels evaluation, but a second one kills the whole process. Furthermore, I added some |
Most shell/repl environments have lead me to assume that the behavior of keyboard commands is as follows:
ctrl + c
: cancel current input and begin a new input linectrl + c
during evaluation : kill current evaluation and begin a new input linectrl + d
: kill shell/repl (EOF) [works as expected inucm
but mentioning here for completeness]Currently, it seems like
ucm
responds toctrl + c
by immediately shutting down, rather than trapping the signal. Ideally,ucm
would handle signals like other shells, and simply swallowctrl + c
/SIGINT
signals to cancel the current input line.The text was updated successfully, but these errors were encountered: