aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/utils/tty.rb
diff options
context:
space:
mode:
authorMike McQuaid2018-02-12 20:50:34 +0000
committerGitHub2018-02-12 20:50:34 +0000
commitb3f0e571f4cdcc29dd6982b863fdcd7de5e6febf (patch)
tree8385418921e394d17a57d368835a0640a1bec171 /Library/Homebrew/utils/tty.rb
parent602696bcb8823e8a24aa87d646aef8c6a108ce4b (diff)
parent7388acb86e0b9811e6badd610255954b3b3a6453 (diff)
downloadbrew-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.rb4
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!