diff options
| author | Mike McQuaid | 2018-02-12 20:50:34 +0000 |
|---|---|---|
| committer | GitHub | 2018-02-12 20:50:34 +0000 |
| commit | b3f0e571f4cdcc29dd6982b863fdcd7de5e6febf (patch) | |
| tree | 8385418921e394d17a57d368835a0640a1bec171 /Library/Homebrew/utils/tty.rb | |
| parent | 602696bcb8823e8a24aa87d646aef8c6a108ce4b (diff) | |
| parent | 7388acb86e0b9811e6badd610255954b3b3a6453 (diff) | |
| download | brew-b3f0e571f4cdcc29dd6982b863fdcd7de5e6febf.tar.bz2 | |
Merge pull request #3090 from jcs/no_color
Tty: if NO_COLOR env var is present, disable color
Diffstat (limited to 'Library/Homebrew/utils/tty.rb')
| -rw-r--r-- | Library/Homebrew/utils/tty.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Library/Homebrew/utils/tty.rb b/Library/Homebrew/utils/tty.rb index e872e6460..81d5f00d7 100644 --- a/Library/Homebrew/utils/tty.rb +++ b/Library/Homebrew/utils/tty.rb @@ -59,7 +59,9 @@ module Tty end def to_s - return "" unless $stdout.tty? + if ENV["HOMEBREW_NO_COLOR"] || !$stdout.tty? + return "" + end current_escape_sequence ensure reset_escape_sequence! |
