Skip to content

Commit c448860

Browse files
authored
Merge pull request #804 from python-cmd2/sane_fix
Fix bug where cmd2 ran 'stty sane' command when stdin was not a terminal
2 parents d591679 + c04c160 commit c448860

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
* Bug Fixes
33
* Fixed bug where setting `use_ipython` to False removed ipy command from the entire `cmd2.Cmd` class instead of
44
just the instance being created
5+
* Fix bug where cmd2 ran 'stty sane' command when stdin was not a terminal
56
* Enhancements
67
* Send all startup script paths to run_script. Previously we didn't do this if the file was empty, but that
78
showed no record of the run_script command in history.

cmd2/cmd2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1607,7 +1607,7 @@ def _run_cmdfinalization_hooks(self, stop: bool, statement: Optional[Statement])
16071607
"""Run the command finalization hooks"""
16081608

16091609
with self.sigint_protection:
1610-
if not sys.platform.startswith('win') and self.stdout.isatty():
1610+
if not sys.platform.startswith('win') and self.stdin.isatty():
16111611
# Before the next command runs, fix any terminal problems like those
16121612
# caused by certain binary characters having been printed to it.
16131613
import subprocess

0 commit comments

Comments
 (0)