mirror of
https://github.com/mpv-player/mpv
synced 2025-01-15 11:31:02 +00:00
mplayer: fix multiline terminal OSD
When an OSD message printed to the terminal was multiple lines, the second line overwrote the status line. If that second line was shorter than the status line, awkward looking remains of the status line were left on the terminal. Fix this by writing an empty status line before printing the OSD message. This will clear the status line text. Also, print the status line again after the OSD message is printed - this makes output consistent with the single-line OSD message case. Remaining caveat: only the last line of a multiline OSD message is cleared when the OSD message is removed. But this is probably fine.
This commit is contained in:
parent
6367ade0b0
commit
62dc32250e
@ -1480,8 +1480,11 @@ static void update_osd_msg(struct MPContext *mpctx)
|
||||
if (strcmp(mpctx->terminal_osd_text, msg->msg)) {
|
||||
talloc_free(mpctx->terminal_osd_text);
|
||||
mpctx->terminal_osd_text = talloc_strdup(mpctx, msg->msg);
|
||||
// Multi-line message => clear what will be the second line
|
||||
write_status_line(mpctx, "");
|
||||
mp_msg(MSGT_CPLAYER, MSGL_STATUS, "%s%s\n", opts->term_osd_esc,
|
||||
mpctx->terminal_osd_text);
|
||||
print_status(mpctx, MP_NOPTS_VALUE, false);
|
||||
}
|
||||
}
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user