summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-01-29 17:15:05 +0100
committerwm4 <wm4@nowhere>2014-01-29 17:15:05 +0100
commit5035bccb4113a8676b514425e994df20bf060d87 (patch)
tree432b01f495464febf2cd9b9e2b877cf688422a2d /common
parent8e61e9ed6e549cfb4ad0180a2ed20d9a2f10fcdc (diff)
downloadmpv-5035bccb4113a8676b514425e994df20bf060d87.tar.bz2
mpv-5035bccb4113a8676b514425e994df20bf060d87.tar.xz
msg: don't clear the status line if new and previous status was empty
This avoids stray newlines when: 1. Some (non-status line) text was output 2. Then an empty status line is output According to the logic, 2. should print an empty line to show the blank status line. Don't do that, and instead output nothing in this case. This caused problems with mpv_identify.sh, and also looked ugly when using --quiet.
Diffstat (limited to 'common')
-rw-r--r--common/msg.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/common/msg.c b/common/msg.c
index 4ef269a963..554ad0d762 100644
--- a/common/msg.c
+++ b/common/msg.c
@@ -210,6 +210,9 @@ static void print_msg_on_terminal(struct mp_log *log, int lev, char *text)
// skip status line output if stderr is a tty but in background
if (terminal_in_background())
return;
+ // don't clear if we don't have to
+ if (!text[0] && !root->status_lines)
+ return;
if (root->termosd) {
prepare_status_line(root, text);
terminate = "\r";