From 5b5ac9494ccd8b7223232b8c640fffb017071000 2020-06-02 13:07:45 From: Min RK Date: 2020-06-02 13:07:45 Subject: [PATCH] use $SHELL in system_piped we already use this in our call to subprocess.call in system_raw used in the terminal this makes kernel behavior better match terminal IPython For an example that used to be different: !wc -l <(pwd) with `SHELL=bash` --- 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):