aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/utils/tty.rb
diff options
context:
space:
mode:
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!