Skip to content

Commit

Permalink
application.py: Respond to NO_COLOR environment variable (#149)
Browse files Browse the repository at this point in the history
Setting NO_COLOR does *not* set `plain_terminal` because that flows into
`self._plain_terminal`, which is used elsewhere for things unrelated to
colors.

Fixes #148.
  • Loading branch information
smcpeak authored May 17, 2024
1 parent f31017b commit ef59024
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion frida_tools/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,10 @@ def __init__(
if hasattr(signal, "SIGPIPE"):
signal.signal(signal.SIGPIPE, signal.SIG_DFL)

colorama.init(strip=True if plain_terminal else None)
# If true, emit text without colors. https://no-color.org/
no_color = plain_terminal or bool(os.environ.get("NO_COLOR"))

colorama.init(strip=True if no_color else None)

parser = self._initialize_arguments_parser()
real_args = compute_real_args(parser, args=args)
Expand Down

0 comments on commit ef59024

Please sign in to comment.