iron.nvim icon indicating copy to clipboard operation
iron.nvim copied to clipboard

:IronRestart in ipython just makes the repl disappear but not restart

Open drusmanbashir opened this issue 2 years ago • 7 comments

Hi I have noticed this bug when doing Deep learning on the GPU. I press shortcut and the entire repl disappears. However the ipython process is not terminated. I can still see the GPU working. In the past, i.e., 2 days ago, the repl would get fully terminated and a new repl would start in its place.

Thanks

drusmanbashir avatar Jun 02 '22 19:06 drusmanbashir

Hi,

Thanks for the issue. I'll double-check. I think I have an idea of why is that.

hkupty avatar Jun 03 '22 14:06 hkupty

For me, calling :IronRestart from another window causes the REPL window to disappear, but if I call it from the window of the repl, then it restarts as it should.

jolars avatar Jun 21 '22 15:06 jolars

I don't know if it's the same issue or something else but with R (or radian) calling :IronRestart I get a similar behavior where the REPL window is closed and a new REPL starts on :IronRepl but the process for the previous R REPL is still visible in htop and the memory is not released.

AdrienLeGuillou avatar Jul 21 '22 13:07 AdrienLeGuillou

Hi @jolars, are you 100% sure it kills the original process before starting a new one? If so, I will probably add a shortkey that combines IronFocus and IronRestart as a workaround

drusmanbashir avatar Jul 27 '22 16:07 drusmanbashir

Hm, actually it is kind of weird. If I start a REPL in one window and call :IronRestart from another buffer (window), the window with the iron REPL is closed but there is still a buffer around that no longer responds to any commands. There is no new Iron REPL either.

jolars avatar Aug 03 '22 19:08 jolars

For me, calling :IronRestart from another window causes the REPL window to disappear, but if I call it from the window of the repl, then it restarts as it should.

I can confirm that calling :IronRestart from inside the REPL does not indeed kill the existing process and free up resources. It just starts a new one. I think a workaround might be to create a shortcut that goes into the REPL, quits it, and then starts a new one. I will add the code snippet here for python when I have it.

drusmanbashir avatar Oct 16 '22 19:10 drusmanbashir

I am working on a work-around on this issue. This keymapping does the following sequence:

  1. Iron focus
  2. quit python
  3. Move to bottom window (my .py buffer)

keymap("n","<M-R>",":IronFocus<CR>Iquit()<CR> <C-w>j", opts)

but if I add IronRepl<CR> at the end of this sequence, I am unable to start iron again. Currently, it does a partial job of quitting python which is not too bad either

drusmanbashir avatar Aug 25 '23 15:08 drusmanbashir