Skip to content

vala, libvaladoc: Fix color support detection in log reporting

Zhou Qiankang requested to merge wszqkzqk/vala:use-writer_supports_color into main

Use GLib.Log.writer_supports_color to replace vala's implementation is_atty.

According to Wikipedia and Windows API docs, determining whether a program under the Windows platform supports ANSI escape codes is actually more complicated. stderr or stdout is a character device and is not a necessary and sufficient condition to support ANSI escape codes.

Vala now repuire GLib version >= 2.56, and GLib has introduced GLib.Log.writer_supports_color since 2.50, we can use this method to replace our basic implementation to solve this problem.

Merge request reports