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
Support {"msg_type":"shutdown_request"} and “quit()” for “ipython console” #153
Comments
There is code to support We should do the right thing when quit() is called, though. It's a bit convoluted: the kernel doesn't shut itself down, but the execute_reply it sends to the frontend includes an ask_exit payload. That will cause the frontend to issue a shutdown_request, and shut itself down as well. |
@ $ ipython console --kernel=ir
IPython Console 3.1.0
In [1]: <C-d>
Do you really want to exit ([y]/n)? y
[1] "Got unhandled msg_type:" "shutdown_request" |
Ah, I bet the shutdown_request is coming over the shell channel instead of the control channel. Technically, the same set of messages can go over either channel. I guess I was testing it on the Qt console, and there shutdown_request actually goes over the control channel. |
jup, if it can come via both, we need to handle it in both. |
ah, |
Yep, also just found out that Maybe overwrite the default quit function to call whatever the kernel needs tell the kernel manager to quit? |
yes, but i think this is getting chaotic. we need to structure everything to make clear how it works
@takluyver what do we do apart from those? |
I don't think we currently inject anything into the user namespace. We inject one function of the In time we probably want to override |
we are shading quit already. but that breaks when clearing the global/user namespace, so maybe we should put it somewhere else. because yeah, it’s the user namespace, not ours. |
Aha, I missed that ;-). What namespace is |
you can easily check that by doing > environment(quit)
<environment: namespace:base>
i think both. all packages are between > search()
[1] ".GlobalEnv" "package:stats" "package:graphics"
[4] "package:grDevices" "package:utils" "package:datasets"
[7] "package:methods" "Autoloads" "package:base" but we actually don’t attach any package, so we either
|
fixed ages ago in #196 |
start a R console with IPython frontend via
ipython console --kernel=ir
pressing C-d will apparently send a
{"msg_type":"shutdown_request"}
message to the kernel. we should support those.other methods to cleanly exit R like calling
quit()
should also work, but instead yield “kernel died, restart ([y]/n)?”The text was updated successfully, but these errors were encountered: