diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2020-01-17 14:23:57 -0500 |
---|---|---|
committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2020-01-17 14:23:57 -0500 |
commit | 2ffdefb6d1f7b2aab63aef529ea4bb46ead42b59 (patch) | |
tree | 5786cdfc4dcc478f78868bf9e2401ff28da120d7 | |
parent | e3b68241eb532dee6430c339534e2ee890abe5a3 (diff) | |
download | cmd2-git-2ffdefb6d1f7b2aab63aef529ea4bb46ead42b59.tar.gz |
Improved responsiveness when setting windows title and printing alerts
-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 |