Disable fancy output when G_MESSAGES_DEBUG is set

Just as we already call flatpak_disable_fancy_output() in
flatpak_option_context_parse() in case verbose output is enabled via CLI
options, disable fancy output in case verbose output was enabled via the
G_MESSAGES_DEBUG env var. Without this change, the result of doing e.g.
$ G_MESSAGES_DEBUG=OSTree flatpak install ...
is pretty useless and ugly, when the output isn't being redirected to a
file, since the debug messages are overwritten when we redraw to show
progress updates.

This makes the output of "flatpak list" a bit ugly when G_MESSAGES_DEBUG
is set, but it seems like a small price to pay.
This commit is contained in:
Phaedrus Leeds
2022-02-20 17:35:49 -06:00
committed by Phaedrus Leeds
parent 12ebf8fd9a
commit 784bc5566d

View File

@@ -721,6 +721,9 @@ flatpak_fancy_output (void)
if (g_strcmp0 (g_getenv ("FLATPAK_FANCY_OUTPUT"), "0") == 0)
return FALSE;
if (getenv ("G_MESSAGES_DEBUG"))
return FALSE;
return isatty (STDOUT_FILENO);
}