diff options
-rw-r--r-- | CHANGELOG.md | 5 | ||||
-rw-r--r-- | cmd2/cmd2.py | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 0523ee5c..e5ee988f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.9.24 (TBD, 2020) +* Enhancements + * Flushing stderr when setting the window title and printing alerts for better responsiveness in cases where + stderr is not unbuffered. + ## 0.9.23 (January 9, 2020) * Bug Fixes * Fixed bug where startup script containing a single quote in its file name was incorrectly quoted diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py index cce281b7..900a2451 100644 --- a/cmd2/cmd2.py +++ b/cmd2/cmd2.py @@ -3802,6 +3802,7 @@ class Cmd(cmd.Cmd): cursor_offset=rl_get_point(), alert_msg=alert_msg) if rl_type == RlType.GNU: sys.stderr.write(terminal_str) + sys.stderr.flush() elif rl_type == RlType.PYREADLINE: # noinspection PyUnresolvedReferences readline.rl.mode.console.write(terminal_str) @@ -3854,6 +3855,7 @@ class Cmd(cmd.Cmd): if self.terminal_lock.acquire(blocking=False): try: sys.stderr.write(ansi.set_title_str(title)) + sys.stderr.flush() except AttributeError: # Debugging in Pycharm has issues with setting terminal title pass |