These are chat archives for ipython/ipython

17th
Jan 2015
Andrew M. C. Dawes
@amcdawes
Jan 17 2015 00:44
@minrk @ellisonbg for the terminal shutdown, changing line 39 of html/terminal/api_handlers.py to tm.terminals[name].ptyproc.terminate()does the job, but it's an ugly hack for bypassing the various methods designed for killing the terminal. Ultimately, the terminate method tries the various ways of killing the process, but it isn't really exposed outside of the ptyprocess layer.
Min RK
@minrk
Jan 17 2015 00:45
Everywhere else we terminate processes, we use a 'try nice shutdown, fallback on kill', we just need to add that to terminado
Andrew M. C. Dawes
@amcdawes
Jan 17 2015 00:47
Right, I'm saying it's already almost exists in terminado by virtue of it using ptyprocess
Min RK
@minrk
Jan 17 2015 00:50
ptyprocess uses time.sleep, which will block the server while it's waiting to shutdown. We just need to copy the same logic to terminado and use async sleep
Andrew M. C. Dawes
@amcdawes
Jan 17 2015 00:53
sure, that works too
still weird that shutdown doesn't work for some of us...
Jonathan Frederic
@jdfreder
Jan 17 2015 00:54
@AlexeyBerezutsky we don't yet provide an "optimized" version of IPython's Javascript.
@AlexeyBerezutsky we do, however, use require.js internally. Thus with small tweaks you can use R.js to compile your own "IPython.js".
Min RK
@minrk
Jan 17 2015 01:10
@amcdawes yeah, something is causing your shell processes to ignore SIGTERM. This is not a crazy thing on its own, but I have no idea what's actually setting the signal handler for you guys
Andrew M. C. Dawes
@amcdawes
Jan 17 2015 04:28
@ellisonbg are you running zsh, or is zsh getting used as your shell within ipython terminals? I just found that zsh ignores SIGTERM on interactive sessions. That's definitely going to keep it from getting killed. If I run export SHELL=/bin/bash and then run ipython notebook, the terminals act as expected
found on a thread here: https://code.launchpad.net/~niclasl/pantheon-terminal/fix-zsh-hang/+merge/230027 also seems to be mentioned in the zsh man page, though not as clearly stated.
Min RK
@minrk
Jan 17 2015 04:39
@amcdawes @ellisonbg can you check #7491? It should handle shells ignoring any signal
Andrew M. C. Dawes
@amcdawes
Jan 17 2015 05:02
hmm, I checked out that branch and now I don't get a terminal tab, probably doing something silly tho
oh, probably failing the terminado version test, I need to get terminado 0.3.3
Andrew M. C. Dawes
@amcdawes
Jan 17 2015 05:10
yes, #7491 fixes it for zsh