From 611a64250a2406ee0bc864ef3d4b565036865911 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Wed, 8 Mar 2023 20:40:06 +0900 Subject: [PATCH] Disable color mode of test-syntax-suggest when on dumb terminal The compliation-mode of Emacs sets TERM to "dumb" and does not support coloring. --- spec/syntax_suggest/spec_helper.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spec/syntax_suggest/spec_helper.rb b/spec/syntax_suggest/spec_helper.rb index 67d401888b..8691246f38 100644 --- a/spec/syntax_suggest/spec_helper.rb +++ b/spec/syntax_suggest/spec_helper.rb @@ -16,6 +16,12 @@ RSpec.configure do |config| config.expect_with :rspec do |c| c.syntax = :expect end + + if config.color_mode == :automatic + if color_enabled? and (ENV["TERM"] == "dumb" or ENV["NO_COLOR"]&.slice(0)) + config.color_mode = :off + end + end end # Used for debugging modifications to