-
-
Notifications
You must be signed in to change notification settings - Fork 417
Commit
#270 by doing explicit kill
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -194,14 +194,22 @@ function waitloop() | |
end | ||
|
||
export notebook | ||
function notebook(jupyter=jupyter) | ||
function notebook(; detached=false) | ||
inited && error("IJulia is already running") | ||
if basename(jupyter) == "jupyter" | ||
# Remove the commit that added this when https://github.com/jupyter/notebook/issues/448 is closed | ||
run(`$jupyter-notebook`) | ||
else | ||
run(`$jupyter notebook`) | ||
p = spawn(detach(`$notebook_cmd`)) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
rened
Member
|
||
if !detached | ||
try | ||
wait(p) | ||
catch e | ||
if isa(e, InterruptException) | ||
kill(p, 2) # SIGINT | ||
else | ||
kill(p) # SIGTERM | ||
rethrow() | ||
end | ||
end | ||
end | ||
return p | ||
end | ||
|
||
end # IJulia |
The change from using
run
to usingdetach
means that there is no output fromnotebook_cmd
visible in the REPL - one does not know if / what got started on which port.