From 03f53a74ac2d3f69c468c9d460bd7fc37a7e41d5 2016-05-30 21:13:02 From: Pavol Juhas Date: 2016-05-30 21:13:02 Subject: [PATCH] Use the default shell to capture shell output. Adhere to the user $SHELL choice when capturing output from system commands. This makes the getoutput() behavior consistent with that of the system() interactive function. --- diff --git a/IPython/utils/_process_common.py b/IPython/utils/_process_common.py index ce2c19e..3062975 100644 --- a/IPython/utils/_process_common.py +++ b/IPython/utils/_process_common.py @@ -17,6 +17,7 @@ of subprocess utilities, and it contains tools that are common to all of them. import subprocess import shlex import sys +import os from IPython.utils import py3compat @@ -70,6 +71,7 @@ def process_handler(cmd, callback, stderr=subprocess.PIPE): # On win32, close_fds can't be true when using pipes for stdin/out/err close_fds = sys.platform != 'win32' p = subprocess.Popen(cmd, shell=isinstance(cmd, py3compat.string_types), + executable=os.environ.get('SHELL'), stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=stderr,