From 385773d2c19ee4da29287bcbf74c38b17999071f Mon Sep 17 00:00:00 2001 From: robnagler Date: Fri, 13 May 2016 19:21:20 +0000 Subject: [PATCH] added terminado_settings --- notebook/notebookapp.py | 5 ++++- notebook/terminal/__init__.py | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/notebook/notebookapp.py b/notebook/notebookapp.py index a4900b2c8..0850afbac 100644 --- a/notebook/notebookapp.py +++ b/notebook/notebookapp.py @@ -608,6 +608,9 @@ class NotebookApp(JupyterApp): help="Supply overrides for the tornado.web.Application that the " "Jupyter notebook uses.") + terminado_settings = Dict(config=True, + help='Supply overrides for terminado. Currently only supports "shell_command".') + cookie_options = Dict(config=True, help="Extra keyword arguments to pass to `set_secure_cookie`." " See tornado's set_secure_cookie docs for details." @@ -1024,7 +1027,7 @@ class NotebookApp(JupyterApp): def init_terminals(self): try: from .terminal import initialize - initialize(self.web_app, self.notebook_dir, self.connection_url) + initialize(self.web_app, self.notebook_dir, self.connection_url, self.terminado_settings) self.web_app.settings['terminals_available'] = True except ImportError as e: log = self.log.debug if sys.platform == 'win32' else self.log.warning diff --git a/notebook/terminal/__init__.py b/notebook/terminal/__init__.py index 9092e13df..90df83073 100644 --- a/notebook/terminal/__init__.py +++ b/notebook/terminal/__init__.py @@ -12,10 +12,10 @@ from notebook.utils import url_path_join as ujoin from .handlers import TerminalHandler, TermSocket from . import api_handlers -def initialize(webapp, notebook_dir, connection_url): - shell = os.environ.get('SHELL') or 'sh' +def initialize(webapp, notebook_dir, connection_url, settings): + shell = settings.get('shell_command', [os.environ.get('SHELL') or 'sh']) terminal_manager = webapp.settings['terminal_manager'] = NamedTermManager( - shell_command=[shell], + shell_command=shell, extra_env={'JUPYTER_SERVER_ROOT': notebook_dir, 'JUPYTER_SERVER_URL': connection_url, },