boot-clj / boot

Build tooling for Clojure.
https://boot-clj.github.io/
Eclipse Public License 1.0
1.75k stars 180 forks source link

BOOT_COLOR configuration option does not work [2.6.0] #533

Closed hlship closed 7 years ago

hlship commented 7 years ago

From util.clj:

(defn colorize?-system-default
  "Return whether we should colorize output on this system. This is
  true, unless we're on Windows, where this is false. The default
  console on Windows does not interprete ansi escape codes. The
  default can be overriden by setting the environment variable
  BOOT_COLOR=1 or BOOT_COLOR=yes to turn it on or any other value to
  turn it off."
  []
  (or (#{"1" "yes"} (boot.App/config "BOOT_COLOR")) (not (boot.App/isWindows))))

From my read, if BOOT_COLOR is some other value (to disable color), then it is ignored, and the isWindows check takes precedence.

My take is that a non-blank value of BOOT_COLOR should decide the value, and only on blank should the isWindows check be used.

I've seen this in practice, where setting BOOT_COLOR to 'off' had no effect, and I had to use the -C option instead.