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.
This commit is contained in:
wm4 2014-01-29 17:15:05 +01:00
parent 8e61e9ed6e
commit 5035bccb41
1 changed files with 3 additions and 0 deletions

View File

@ -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 // skip status line output if stderr is a tty but in background
if (terminal_in_background()) if (terminal_in_background())
return; return;
// don't clear if we don't have to
if (!text[0] && !root->status_lines)
return;
if (root->termosd) { if (root->termosd) {
prepare_status_line(root, text); prepare_status_line(root, text);
terminate = "\r"; terminate = "\r";