diff --git a/bin/vagrant b/bin/vagrant index fce68c857..b9ef5feee 100755 --- a/bin/vagrant +++ b/bin/vagrant @@ -139,7 +139,7 @@ begin end # Also allow users to force colors. - if argv.include?("--color") + if argv.include?("--color") || ENV["VAGRANT_FORCE_COLOR"] argv.delete("--color") opts[:ui_class] = Vagrant::UI::Colored end diff --git a/website/source/docs/other/environmental-variables.html.md b/website/source/docs/other/environmental-variables.html.md index 6bf493e6d..89e784210 100644 --- a/website/source/docs/other/environmental-variables.html.md +++ b/website/source/docs/other/environmental-variables.html.md @@ -97,6 +97,16 @@ The equivalent behavior can be achieved by using the `--no-color` flag on a command-by-command basis. This environmental variable is useful for setting this flag globally. +## `VAGRANT_FORCE_COLOR` + +If this is set to any value, then Vagrant will force colored output, even +if it detected that there is no TTY or the current environment does not +support it. + +The equivalent behavior can be achieved by using the `--color` flag on a +command-by-command basis. This environmental variable is useful for setting +this flag globally. + ## `VAGRANT_NO_PLUGINS` If this is set to any value, then Vagrant will not load any 3rd party