From 1ea8230d264d354640e6bd16bedff4850181e7c8 2020-06-02 22:49:38 From: Matthias Bussonnier Date: 2020-06-02 22:49:38 Subject: [PATCH] Merge pull request #12361 from meeseeksmachine/auto-backport-of-pr-12360-on-7.x Backport PR #12360 on branch 7.x (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):