I'm actively developing a large codebase that I load every time I use Mathematica. I frequently quit my kernel and reload the codebase to incorporate new changes. I've created a custom menu by editing MenuSetup.tr
to include menu items and keyboard shortcuts that allow me to quit the kernel and reload my codebase quickly and easily.
Unfortunately, the 'Quit' functionality no longer works in Mathematica 10. Both the "EvaluatorQuit"
FrontEndToken
and manually running KernelExecute[ToExpression["Quit[]"]]
from a MenuItem
cause the FrontEnd to crash (the code used in my MenuItem
is derived from this thread). The same bits of code work fine when run directly from the FrontEnd.
There clearly still exists a viable method of quitting a kernel from a menu, because the 'Quit Kernel' submenu in the 'Evaluation' menu still functions fine without crashing the FrontEnd. Unfortunately, the way this is done seems to be hidden behind the "MenuListQuitEvaluators"
token used to generate that submenu.
Any advice on how to get around this bothersome crashing behavior would be most welcome.
"EvaluatorQuit"
working in version 9? I suspect that the issue is somewhat connected with introducing the service kernel in v.9: are you sure in which of two kernels the commandQuit[]
will be evaluated? $\endgroup$"EvaulatorQuit"
did not crash the FrontEnd in version 9 even when run from within a MenuItem. I wasn't aware of the distinction between the service kernel and the user kernel(s), but it certainly seems that"EvaluatorQuit"
was operating on the user kernel rather than on the service kernel. The state of the user kernel is reset when the command is run (or Up/Down/OwnValues are lost at least). Has something changed w.r.t. the service/user kernel distinction in Mathematica 10? $\endgroup$"EvaluatorQuit"
looks like a bug in any case. The Documentation page seems misleading: it states that ""EvaluatorQuit"
requires a parameter, which can be the name of a kernel (evaluator) orAutomatic
for the default kernel," but the example given has no parameter. $\endgroup$