Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions notebook/notebookapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -1187,6 +1187,16 @@ def _update_server_extensions(self, change):
"0 (the default) disables this automatic shutdown.")
)

terminals_enabled = Bool(True, config=True,
help=_("""Set to False to disable terminals.

This does *not* make the notebook server more secure by itself.
Anything the user can in a terminal, they can also do in a notebook.

Terminals may also be automatically disabled if the terminado package
is not available.
"""))

def parse_command_line(self, argv=None):
super(NotebookApp, self).parse_command_line(argv)

Expand Down Expand Up @@ -1345,6 +1355,9 @@ def _url(self, ip):
return "%s://%s:%i%s" % (proto, ip, self.port, self.base_url)

def init_terminals(self):
if not self.terminals_enabled:
return

try:
from .terminal import initialize
initialize(self.web_app, self.notebook_dir, self.connection_url, self.terminado_settings)
Expand Down