In this post, we discussed adding another option for restoring stack windows, which it seems only works on windows. The process is the same, besides the command that should be executed.
Open this file (assuming you installed Mathematica on C
drive):
"C:\Program Files\Wolfram Research\Mathematica\12.3\SystemFiles\FrontEnd\TextResources\Windows\MenuSetup.tr"
There are also MenuSetup.tr
for other languages.
Find Menu["&Edit",
and add this after Redo
:
MenuItem["Clear All", KernelExecute[ClearAll["Global`*"];], MenuKey["C", Modifiers->{"Command","Shift","Control"}], MenuEvaluator -> Automatic],
The code uses ClearAll["Global`*"]
to clear all the variables define in the Global
context, feel free to change it.
Also, I'm not sure whether Alt+Ctrl+Shift+C conflicts with other commands. I tried to pick a hard one.
If you found a solution for macOS, feel free to edit or comment on the post.
Quit[]
instead because it is guaranteed to erase every little thing. $\endgroup$cl
first time after it was defined, will also clearcl
itself. So the definition is lost and have to be typed again and we are back to square one. $\endgroup$