added terminado_settings

pull/1466/head
robnagler 10 years ago
parent a7da78127a
commit 385773d2c1

@ -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

@ -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,
},

Loading…
Cancel
Save