diff options
author | Lars Wirzenius <liw@liw.fi> | 2015-10-11 19:05:37 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2015-10-11 19:05:37 +0300 |
commit | 81407f99974d1140142381a3ad4b72703e4f5496 (patch) | |
tree | a7cc0e5a6e9facd19747b63a1d1266c004636daa | |
parent | dcbb88c57232c8022e2b20da24cda83108aeb95f (diff) | |
download | python-ttystatus-81407f99974d1140142381a3ad4b72703e4f5496.tar.gz |
Only write \n in finish if there's a message
Otherwise, there's nothing on the terminal, and no need for the
newline. The point of writing the newline is to that the shell prompt,
after the program finishes, starts at the beginning of the first line
after the last line of progress output.
-rw-r--r-- | ttystatus/messager.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ttystatus/messager.py b/ttystatus/messager.py index 00b05d1..9f81690 100644 --- a/ttystatus/messager.py +++ b/ttystatus/messager.py @@ -131,4 +131,5 @@ class Messager(object): '''Finalize output.''' if self._enabled and self._cached_message is not None: self.write(self._cached_message) - self._terminal.write('\n') + if self._cached_message: + self._terminal.write('\n') |