mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-24 12:05:22 +08:00
Fix for the terminal shutdown issue (#4180)
This patch prevents creation of a new terminal when handling websocket handshaking request. The default behavior of `terminado.NamedTermManager` is to automatically start a new terminal in response to a websocket handshake, which prevents a terminal from being properly shut down in JupyterLab as reported in this [issue](jupyterlab/jupyterlab#5061).
This commit is contained in:
parent
b5b44eb520
commit
866f4f8e0d
@ -31,6 +31,8 @@ class TermSocket(WebSocketMixin, IPythonHandler, terminado.TermSocket):
|
||||
def get(self, *args, **kwargs):
|
||||
if not self.get_current_user():
|
||||
raise web.HTTPError(403)
|
||||
if not args[0] in self.term_manager.terminals:
|
||||
raise web.HTTPError(404)
|
||||
return super(TermSocket, self).get(*args, **kwargs)
|
||||
|
||||
def on_message(self, message):
|
||||
|
Loading…
Reference in New Issue
Block a user