IJulia.jl icon indicating copy to clipboard operation
IJulia.jl copied to clipboard

Can't terminate `notebook()` function in Julia REPL in 1.8 on Windows

Open nilshg opened this issue 1 year ago • 4 comments

In 1.7.3 I can do:

julia> using IJulia

julia> notebook()
[ Info: running setenv(...)

# Single Ctrl+C

Process(setenv(..., ProcessSignaled(2))

julia> 

In 1.8-rc3 this doesn't work (tested on both cmd.exe and powershell):

julia> using IJulia

julia> notebook()
[ Info: running setenv(...)

# Single Ctrl+C

# Nothing happens

# Multiple Ctrl+Cs

WARNING: Force throwing a SIGINT

and the whole Julia session is dead.

nilshg avatar Aug 03 '22 12:08 nilshg

Edited to add that this isn't fixed by using 1.8 stable release. There's a related Pluto issue here: https://github.com/fonsp/Pluto.jl/issues/2136

nilshg avatar Aug 30 '22 14:08 nilshg

Some slightly different results for Debian 11 (bullseye):

Julia 1.8.0, JupyterLab Terminal

julia> using IJulia

julia> notebook()
[ Info: running `/usr/local/bin/jupyter notebook`
^C^C^C^C^C^CWARNING: Force throwing a SIGINT
Process(setenv(`/usr/local/bin/jupyter notebook`; dir="/home/benz0li"), ProcessExited(0))

julia>

Julia 1.8.0, code-server (aka VS Code) Terminal, Julia REPL

julia> using IJulia

julia> notebook()
[ Info: running `/usr/local/bin/jupyter notebook`
^C
Process(setenv(`/usr/local/bin/jupyter notebook`; dir="/home/benz0li"), ProcessExited(0))

julia>

ℹ️ May be reproduced at https://demo.jupyter.b-data.ch or with docker run --rm -it -p 8888:8888 registry.gitlab.b-data.ch/jupyterlab/julia/pubtools

benz0li avatar Aug 30 '22 14:08 benz0li

I opened a Julia issue about a change in interrupt behaviour on Julia 1.8, which I suspect to be the cause here.

https://github.com/JuliaLang/julia/issues/46635

So far I only have my result on MacOS, perhaps someone using a different OS could try to reproduce the issue, and leave a comment with their versioninfo()?

fonsp avatar Sep 05 '22 12:09 fonsp

In Pluto, we were able to work around this issue, see https://github.com/fonsp/Pluto.jl/pull/2293 , maybe the same technique would also work for IJulia! See https://github.com/JuliaLang/julia/issues/46635 for a discussion about this workaround and alternatives.

fonsp avatar Sep 21 '22 12:09 fonsp