Description: Fall back to another tty detection method if jansi CLibrary isn't available
Author: Emmanuel Bourg <ebourg@apache.org>
Forwarded: not-needed
Last-Update: 2023-02-03

--- a/compiler/cli/src/org/jetbrains/kotlin/cli/common/messages/PlainTextMessageRenderer.java
+++ b/compiler/cli/src/org/jetbrains/kotlin/cli/common/messages/PlainTextMessageRenderer.java
@@ -42,7 +42,7 @@
                 colorEnabled = CLibrary.isatty(CLibrary.STDERR_FILENO) != 0;
             }
             catch (UnsatisfiedLinkError e) {
-                colorEnabled = false;
+                colorEnabled = System.console() != null;
             }
         }
         COLOR_ENABLED = colorEnabled;
