summaryrefslogtreecommitdiff
path: root/lib/irb/color.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/irb/color.rb')
-rw-r--r--lib/irb/color.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/irb/color.rb b/lib/irb/color.rb
index c4513f5b0b..8307af25a9 100644
--- a/lib/irb/color.rb
+++ b/lib/irb/color.rb
@@ -77,7 +77,15 @@ module IRB # :nodoc:
class << self
def colorable?
- $stdout.tty? && (/mswin|mingw/ =~ RUBY_PLATFORM || (ENV.key?('TERM') && ENV['TERM'] != 'dumb')) && IRB.conf.fetch(:USE_COLORIZE, true)
+ supported = $stdout.tty? && (/mswin|mingw/ =~ RUBY_PLATFORM || (ENV.key?('TERM') && ENV['TERM'] != 'dumb'))
+
+ # because ruby/debug also uses irb's color module selectively,
+ # irb won't be activated in that case.
+ if IRB.respond_to?(:conf)
+ supported && IRB.conf.fetch(:USE_COLORIZE, true)
+ else
+ supported
+ end
end
def inspect_colorable?(obj, seen: {}.compare_by_identity)