mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
tools/pw-dump: only print colors if we're connected to a terminal
We don't want ansi escape codes in the output of `pw-dump > log`. And where colors are needed after the fact, it's easy to just run `jq . $file`.
This commit is contained in:
parent
65e14548a3
commit
af63d08453
1 changed files with 1 additions and 1 deletions
|
|
@ -1429,7 +1429,7 @@ int main(int argc, char *argv[])
|
|||
pw_init(&argc, &argv);
|
||||
|
||||
data.out = stdout;
|
||||
if (getenv("NO_COLOR") == NULL)
|
||||
if (isatty(fileno(data.out) && getenv("NO_COLOR") == NULL))
|
||||
colors = true;
|
||||
|
||||
while ((c = getopt_long(argc, argv, "hVr:mN", long_options, NULL)) != -1) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue