mirror of https://github.com/mpv-player/mpv
player: do not cut off terminal status line if it contains newlines
Just a heuristic to preserve the status line in odd corner cases. Probably a crap idea. Fixes #3340.
This commit is contained in:
parent
f29bba1123
commit
831fc4f012
|
@ -132,7 +132,7 @@ static void term_osd_set_status(struct MPContext *mpctx, const char *text)
|
|||
|
||||
int w = 80, h = 24;
|
||||
terminal_get_size(&w, &h);
|
||||
if (strlen(mpctx->term_osd_status) > w)
|
||||
if (strlen(mpctx->term_osd_status) > w && !strchr(mpctx->term_osd_status, '\n'))
|
||||
mpctx->term_osd_status[w] = '\0';
|
||||
|
||||
term_osd_update(mpctx);
|
||||
|
|
Loading…
Reference in New Issue