core.loggingmanager: Disable pretty printing when not connected to a tty
authorKim Alvefur <zash@zash.se>
Sun, 04 Jul 2021 15:11:53 +0200
changeset 11661 46fa1b939e88
parent 11660 c368b4f6ee04
child 11662 36942fa001b4
core.loggingmanager: Disable pretty printing when not connected to a tty Things can behave unexpectedly when fed ANSI escape codes.
core/loggingmanager.lua
--- a/core/loggingmanager.lua	Sun Jul 04 15:11:07 2021 +0200
+++ b/core/loggingmanager.lua	Sun Jul 04 15:11:53 2021 +0200
@@ -213,7 +213,7 @@
 end
 log_sink_types.stdout = log_to_stdout;
 
-local do_pretty_printing = true;
+local do_pretty_printing = not have_pposix or pposix.isatty(stdout);
 
 local logstyles, pretty;
 if do_pretty_printing then