This PR checks for a non-empty NO_COLOR environment variable and displays templates without color if one is present, as specified by the references in #447.
Run your project with color support by ensuring NO_COLOR is not set:
$ unset NO_COLOR
$ ./your-survey-project
Run your project with colors removed from survey outputs:
$ export NO_COLOR=true
$ ./your-survey-project
Notes
No modifications are made to user-passed prompt values such as Message, Options, Help, and so forth. Removing color from these values is instead left to the caller of this package.
Summary
This PR checks for a non-empty
NO_COLOR
environment variable and displays templates without color if one is present, as specified by the references in #447.Fixes #447
Preview
https://user-images.githubusercontent.com/18134219/205460922-8b6a854b-e4e6-4daf-93b8-3e8ed63ca6be.mov
Reviewers
The following steps can be used to inspect these changes:
survey
, append the following to yourgo.mod
, pointing to your localsurvey
source:NO_COLOR
is not set:survey
outputs:Notes
Message
,Options
,Help
, and so forth. Removing color from these values is instead left to the caller of this package.