diff options
author | Guy Harris <guy@alum.mit.edu> | 2019-04-02 21:47:42 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2019-04-03 05:59:51 +0000 |
commit | 505c3187a4fd33803edc55e345ec65a5ebff3754 (patch) | |
tree | 77c73d85000e799b71d9b08499cdd25a575171b8 /fileset.c | |
parent | c1e404a36f3acb5387afe208a98dd994d443443f (diff) |
Clean up color handling.
For Windows:
Don't use ws_isatty() - which is a wrapper around _isatty() - to
determine whether the output is to a Windows console or not; it returns
a non-zero value for *any* character device, not just a console.
Instead, use a console API; if it succeeds, it's a console, otherwise it
isn't.
If we're writing to a console, and the
ENABLE_VIRTUAL_TERMINAL_PROCESSING flag is set, or it isn't set but we
can set it, assume the console supports the escape sequences that
request 24-bit color, and use them.
For UN*X:
We can isatty() to determine if the output is to a terminal, as it
doesn't check for character special files, it specifically checks for
terminals (which, in practice, means "device that supports one of the
ioctls to get terminal modes" in most if not all cases; that covers
serial lines, pseudo-ttys, and perhaps some other devices).
Only use the 24-bit color escape sequences if the COLORTERM environment
variable is set to "truecolor" or "24bit".
Bug: 15659
Change-Id: I673667b86bd6b2ab48c06e00ed16b537d6723453
Reviewed-on: https://code.wireshark.org/review/32689
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'fileset.c')
0 files changed, 0 insertions, 0 deletions