From 31133c3a5766f23a8b1c067319dc4d5c0c182355 2020-06-02 20:08:35 From: Matthias Bussonnier Date: 2020-06-02 20:08:35 Subject: [PATCH] Backport PR #12360: use $SHELL in system_piped --- diff --git a/IPython/utils/_process_posix.py b/IPython/utils/_process_posix.py index f3f93f7..a11cad7 100644 --- a/IPython/utils/_process_posix.py +++ b/IPython/utils/_process_posix.py @@ -59,11 +59,12 @@ class ProcessHandler(object): @property def sh(self): - if self._sh is None: - self._sh = pexpect.which('sh') + if self._sh is None: + shell_name = os.environ.get("SHELL", "sh") + self._sh = pexpect.which(shell_name) if self._sh is None: - raise OSError('"sh" shell not found') - + raise OSError('"{}" shell not found'.format(shell_name)) + return self._sh def __init__(self, logfile=None, read_timeout=None, terminate_timeout=None):