Skip to content

Commit 4e359c9

Browse files
committed
Merge pull request #1466 from robnagler/robnagler-terminado_settings
added terminado_settings
2 parents f8211ee + 385773d commit 4e359c9

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

notebook/notebookapp.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -608,6 +608,9 @@ def _webapp_settings_changed(self, name, old, new):
608608
help="Supply overrides for the tornado.web.Application that the "
609609
"Jupyter notebook uses.")
610610

611+
terminado_settings = Dict(config=True,
612+
help='Supply overrides for terminado. Currently only supports "shell_command".')
613+
611614
cookie_options = Dict(config=True,
612615
help="Extra keyword arguments to pass to `set_secure_cookie`."
613616
" See tornado's set_secure_cookie docs for details."
@@ -1024,7 +1027,7 @@ def _url(self, ip):
10241027
def init_terminals(self):
10251028
try:
10261029
from .terminal import initialize
1027-
initialize(self.web_app, self.notebook_dir, self.connection_url)
1030+
initialize(self.web_app, self.notebook_dir, self.connection_url, self.terminado_settings)
10281031
self.web_app.settings['terminals_available'] = True
10291032
except ImportError as e:
10301033
log = self.log.debug if sys.platform == 'win32' else self.log.warning

notebook/terminal/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
from .handlers import TerminalHandler, TermSocket
1313
from . import api_handlers
1414

15-
def initialize(webapp, notebook_dir, connection_url):
16-
shell = os.environ.get('SHELL') or 'sh'
15+
def initialize(webapp, notebook_dir, connection_url, settings):
16+
shell = settings.get('shell_command', [os.environ.get('SHELL') or 'sh'])
1717
terminal_manager = webapp.settings['terminal_manager'] = NamedTermManager(
18-
shell_command=[shell],
18+
shell_command=shell,
1919
extra_env={'JUPYTER_SERVER_ROOT': notebook_dir,
2020
'JUPYTER_SERVER_URL': connection_url,
2121
},

0 commit comments

Comments
 (0)