diff options
author | Jeff Quast <contact@jeffquast.com> | 2014-06-08 08:07:03 +0000 |
---|---|---|
committer | Jeff Quast <contact@jeffquast.com> | 2014-06-08 08:07:03 +0000 |
commit | abe09d65daa99aab33b08a00f2c183b67e7f9ad3 (patch) | |
tree | d024f355e65701d87a942d37b8fab01930e91909 /pexpect/replwrap.py | |
parent | 06f1bf9244ec8806288d1664b0421e19c8bd364a (diff) | |
download | pexpect-git-abe09d65daa99aab33b08a00f2c183b67e7f9ad3.tar.gz |
Solaris support, tested on SmartOS from cron(1).
Diffstat (limited to 'pexpect/replwrap.py')
-rw-r--r-- | pexpect/replwrap.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/pexpect/replwrap.py b/pexpect/replwrap.py index af4f889..a36678c 100644 --- a/pexpect/replwrap.py +++ b/pexpect/replwrap.py @@ -34,11 +34,14 @@ class REPLWrapper(object): new_prompt=PEXPECT_PROMPT, continuation_prompt=PEXPECT_CONTINUATION_PROMPT): if isinstance(cmd_or_spawn, str): - self.child = pexpect.spawnu(cmd_or_spawn) + self.child = pexpect.spawnu(cmd_or_spawn, echo=False) else: self.child = cmd_or_spawn - self.child.setecho(False) # Don't repeat our input. - self.child.waitnoecho() + if self.child.echo: + # Existing spawn instance has echo enabled, disable it + # to prevent our input from being repeated to output. + self.child.setecho(False) + self.child.waitnoecho() if prompt_change is None: self.prompt = orig_prompt |