summaryrefslogtreecommitdiffstats
path: root/common/msg.c
diff options
context:
space:
mode:
authorKacper Michajłow <kasper93@gmail.com>2024-01-04 21:01:01 +0100
committersfan5 <sfan5@live.de>2024-01-15 10:39:42 +0100
commit13ed292ab054ba09f9257d9c510cd7ce39f4b7d3 (patch)
tree5004e185c7a6b031a42f71cce4212f0331c7c95e /common/msg.c
parentab60ad861971c5c01c877ee7d0b897ea285bd0e9 (diff)
downloadmpv-13ed292ab054ba09f9257d9c510cd7ce39f4b7d3.tar.bz2
mpv-13ed292ab054ba09f9257d9c510cd7ce39f4b7d3.tar.xz
terminal: don't print escape sequence if not tty
Diffstat (limited to 'common/msg.c')
-rw-r--r--common/msg.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/common/msg.c b/common/msg.c
index f435d6e206..20f1ce0abb 100644
--- a/common/msg.c
+++ b/common/msg.c
@@ -257,7 +257,9 @@ void mp_msg_flush_status_line(struct mp_log *log, bool clear)
goto done;
if (!clear) {
- fprintf(stderr, TERM_ESC_RESTORE_CURSOR "\n");
+ if (log->root->isatty[STDERR_FILENO])
+ fprintf(stderr, TERM_ESC_RESTORE_CURSOR);
+ fprintf(stderr, "\n");
log->root->blank_lines = 0;
log->root->status_lines = 0;
goto done;