Do you really want to quit the kernel? Yes!

You can add this to your init file, (or just try it out for the current session). It will add a Quit to your key events. This Quit doesn't open a confirm dialog.

FrontEndExecute[
 FrontEnd`AddMenuCommands["MenuListQuitEvaluators",
  {MenuItem["AddMenu &Quit",
    FrontEnd`KernelExecute[ToExpression["Quit[]"]],
    MenuKey["q", Modifiers -> {"Control"}],
    System`MenuEvaluator -> Automatic]}]]

ref. https://mathematica.stackexchange.com/a/6227/363

Alternatively, it can be added to MenuSetup.tr like so:

Menu["Quit Local",
{
  MenuItem["Quit Kernel",
    FrontEnd`KernelExecute[ToExpression["Quit[]"]],
    MenuKey["q", Modifiers -> {"Control"}],
    MenuEvaluator -> Automatic]
}]

My approach is to use a macro I created in a 3rd-party task automation program (Keyboard Maestro for MacOS; I believe alternatives exist for Windows and Linux). Thus, rather than modifying MMA, I assigned a shortcut to a macro that executes MMA's normal sequence for quitting the kernel.

Specifically, when I press Cmd+Shift+Q, the macro does: Evaluation->Quit Kernel->Local->Quit.

One advantage of this approach is that, so long as Wolfram does not change the menu steps for quitting the kernel, it should work reliably in all versions of MMA.

I'm not familiar with other programs, but creating the macro in Keyboard Maestro is fairly easy; I just had to select three panels from its library of "Actions", add them to the macro, and fill them in appropriately. Here's a screenshot of it:

enter image description here

Tags:

Front End