diff options
| author | Jared Crapo <jared@kotfu.net> | 2017-08-23 14:33:13 -0600 |
|---|---|---|
| committer | Jared Crapo <jared@kotfu.net> | 2017-08-23 14:33:13 -0600 |
| commit | 64e19334cf6aac8edeecf8e7f8725d00da758ee5 (patch) | |
| tree | 8da3b45dbbae84f7a532790ad8b239181441c098 | |
| parent | ba1319f22f9e116a12d525d8d1d50cfe6318db4c (diff) | |
| download | cmd2-git-64e19334cf6aac8edeecf8e7f8725d00da758ee5.tar.gz | |
Don’t try and sane the tty if stdin isn’t a tty
| -rwxr-xr-x | cmd2.py | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -717,8 +717,9 @@ class Cmd(cmd.Cmd): """ if not sys.platform.startswith('win'): # Fix those annoying problems that occur with terminal programs like "less" when you pipe to them - proc = subprocess.Popen(shlex.split('stty sane')) - proc.communicate() + if self.stdin.isatty(): + proc = subprocess.Popen(shlex.split('stty sane')) + proc.communicate() return stop def parseline(self, line): |
