diff --git a/appveyor.yml b/appveyor.yml index 68bf1bc94f..3b817395ae 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -23,4 +23,4 @@ install: - cmd: pip install .[test] test_script: - - nosetests --exclude-dir notebook\terminal -v notebook + - nosetests -v notebook diff --git a/notebook/notebookapp.py b/notebook/notebookapp.py index 4baf4f256a..c8e204fb97 100755 --- a/notebook/notebookapp.py +++ b/notebook/notebookapp.py @@ -1328,8 +1328,7 @@ def init_terminals(self): 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 - log(_("Terminals not available (error was %s)"), e) + self.log.warning(_("Terminals not available (error was %s)"), e) def init_signal(self): if not sys.platform.startswith('win') and sys.stdin and sys.stdin.isatty(): diff --git a/notebook/terminal/__init__.py b/notebook/terminal/__init__.py index 90df830731..e165ef7471 100644 --- a/notebook/terminal/__init__.py +++ b/notebook/terminal/__init__.py @@ -3,9 +3,10 @@ import terminado from ..utils import check_version -if not check_version(terminado.__version__, '0.3.3'): - raise ImportError("terminado >= 0.3.3 required, found %s" % terminado.__version__) +if not check_version(terminado.__version__, '0.8.1'): + raise ImportError("terminado >= 0.8.1 required, found %s" % terminado.__version__) +from ipython_genutils.py3compat import which from terminado import NamedTermManager from tornado.log import app_log from notebook.utils import url_path_join as ujoin @@ -13,7 +14,12 @@ from . import api_handlers def initialize(webapp, notebook_dir, connection_url, settings): - shell = settings.get('shell_command', [os.environ.get('SHELL') or 'sh']) + default_shell = which('sh') + if not default_shell and os.name == 'nt': + default_shell = 'powershell.exe' + shell = settings.get('shell_command', + [os.environ.get('SHELL') or default_shell] + ) terminal_manager = webapp.settings['terminal_manager'] = NamedTermManager( shell_command=shell, extra_env={'JUPYTER_SERVER_ROOT': notebook_dir, diff --git a/setup.py b/setup.py index c90c95314c..ace0ac4f4f 100755 --- a/setup.py +++ b/setup.py @@ -153,9 +153,9 @@ 'nbconvert', 'ipykernel', # bless IPython kernel for now 'Send2Trash', + 'terminado>=0.8.1' ] extras_require = { - ':sys_platform != "win32"': ['terminado>=0.3.3'], 'test:python_version == "2.7"': ['mock'], 'test': ['nose', 'coverage', 'requests', 'nose_warnings_filters', 'nbval'], 'test:sys_platform == "win32"': ['nose-exclude'],