dccsillag / magma-nvim

Interact with Jupyter from NeoVim.
GNU General Public License v3.0
988 stars 50 forks source link

[Feature Request] Kernel Interrupt and Kernel Restart functions #34

Closed tbung closed 2 years ago

tbung commented 2 years ago

Is your feature request related to a problem? Please describe. Sometimes I might start long running cells and notice a mistake in the code while it's running, interrupting the kernel saves me from deinitializing and reinitializing magma. Similarly, sometimes the kernel gets into a failure state regarding one cell or one might get rid of memory-heavy variables that the kernel has loaded, in that case restarting the kernel might be necessary.

Describe the solution you'd like Two commands, MagmaInterrupt and MagmaRestart, that do the afforementioned things.

Describe alternatives you've considered The only alternative I can think of is to use MagmaDeinit and MagmaInit to get a fresh kernel. Another thing worth considering is to add MagmaStart and MagmaStop functions that (re)start or stop a kernel, also a flag or separate command for restarting and clearing all output together might be a nice addition (this could even be nice default behaviour for MagmaRestart.

Additional context I have already implemented this feature in my fork, have verified that it works, and will open a pull request.

Thanks for this great project!

dccsillag commented 2 years ago

Yeah, we should totally have these. Will take a look at the PR.