After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 769859 - structural logging does not support colored output to Windows console
structural logging does not support colored output to Windows console
Status: RESOLVED DUPLICATE of bug 775468
Product: glib
Classification: Platform
Component: general
unspecified
Other Windows
: Normal minor
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2016-08-13 17:22 UTC by LRN
Modified: 2016-12-05 04:43 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gtkicontheme: check if the context quark string is not null (1.01 KB, patch)
2016-10-17 11:04 UTC, Ignacio Casal Quinteiro (nacho)
committed Details | Review

Description LRN 2016-08-13 17:22:45 UTC
Because currently coloring is achieved by inserting terminal codes that Windows console does not support and displays simply as weird characters.

Outputting colored text can be achieved using two methods:

1) previous = GetConsoleScreenBufferInfo() -> SetConsoleTextAttribute(color) -> output text -> SetConsoleTextAttribute (previous)

This requires locking, otherwise multithreaded output will be a mess (more so than it already is)

2) WriteConsoleOutput()

This modifies console buffer directly and writes rectangular blocks into rectangular buffer space (no built-in line wrapping support).


GStreamer uses (1).

Another thing of note: it might be desirable to be able to force glib to do coloring using terminal codes. This is useful when piping the output to `less' or other programs that *do* understand these codes.
Comment 1 Ignacio Casal Quinteiro (nacho) 2016-10-17 11:04:16 UTC
Created attachment 337828 [details] [review]
gtkicontheme: check if the context quark string is not null

On windows you might not have a theme installed by default which
means that when trying to create the context quark it will fail.
If then we try to replace a NULL key in the hash table it will crash.
Comment 2 Ignacio Casal Quinteiro (nacho) 2016-10-17 11:04:54 UTC
Attachment 337828 [details] pushed as a12b691 - gtkicontheme: check if the context quark string is not null
Comment 3 Ignacio Casal Quinteiro (nacho) 2016-10-17 11:05:24 UTC
Sorry attached to the wrong bug report :(
Comment 4 Fan, Chun-wei 2016-12-05 04:43:31 UTC

*** This bug has been marked as a duplicate of bug 775468 ***