Programmatically restart julia

FYI, a more complete function by @fredrikekre is available here, and it is called restart().

I added it to the startup.jl file and tested it in VS Code and in a standalone Julia REPL and it seems to work very well.

For the latter, it restarts the REPL in the same window very quickly in Julia 1.9 and thus, it might be seen as a “clear workspace” analogue.

2 Likes