File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -75,6 +75,16 @@ function main()
7575 @warn " IJulia doesn't have register_mime; WebIO may not work as expected. Please upgrade to IJulia v1.13.0 or greater."
7676 end
7777
78+ # Delete any old comms before displaying the first WEBIO_NODE_MIME content (which prompts a new connection)
79+ # Reason: If a freshly opened notebook has previously rendered WEBIO_NODE_MIME, an old comm is
80+ # (incorrectly) registered from/by jupyter before WebIO has been init'ed
81+ for (k,v) in IJulia. CommManager. comms
82+ if IJulia. CommManager. comm_target (v) == :webio_comm
83+ IJulia. CommManager. close_comm (v)
84+ delete! (IJulia. CommManager. comms, k)
85+ end
86+ end
87+
7888 # See comment on _IJuliaInit for what this does
7989 display (_IJuliaInit ())
8090end
You can’t perform that action at this time.
0 commit comments