summaryrefslogtreecommitdiff
path: root/pexpect/replwrap.py
diff options
context:
space:
mode:
Diffstat (limited to 'pexpect/replwrap.py')
-rw-r--r--pexpect/replwrap.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/pexpect/replwrap.py b/pexpect/replwrap.py
index 2e50286..7b0e823 100644
--- a/pexpect/replwrap.py
+++ b/pexpect/replwrap.py
@@ -1,5 +1,6 @@
"""Generic wrapper for read-eval-print-loops, a.k.a. interactive shells
"""
+import os.path
import signal
import sys
import re
@@ -104,7 +105,9 @@ def python(command="python"):
"""Start a Python shell and return a :class:`REPLWrapper` object."""
return REPLWrapper(command, u(">>> "), u("import sys; sys.ps1={0!r}; sys.ps2={1!r}"))
-def bash(command="bash", orig_prompt=re.compile('[$#]')):
+def bash(command="bash"):
"""Start a bash shell and return a :class:`REPLWrapper` object."""
- return REPLWrapper(command, orig_prompt, u("PS1='{0}' PS2='{1}' PROMPT_COMMAND=''"),
+ bashrc = os.path.join(os.path.dirname(__file__), 'bashrc.sh')
+ child = pexpect.spawnu(command, ['--rcfile', bashrc], echo=False)
+ return REPLWrapper(child, u'\$', u("PS1='{0}' PS2='{1}' PROMPT_COMMAND=''"),
extra_init_cmd="export PAGER=cat")