From eb6256316c34c2aa0ce0ad3252f95698aeded8ef Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 23 Oct 2013 23:20:27 -0700 Subject: [PATCH] core: improved commenting in bin/vagrant --- bin/vagrant | 4 +++- lib/vagrant/util/platform.rb | 5 +---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/bin/vagrant b/bin/vagrant index 4a330d1f3..fa51feb6a 100755 --- a/bin/vagrant +++ b/bin/vagrant @@ -37,7 +37,9 @@ if ARGV.include?("--no-color") elsif !Vagrant::Util::Platform.terminal_supports_colors? opts[:ui_class] = Vagrant::UI::Basic elsif !$stdout.tty? && !Vagrant::Util::Platform.cygwin? - opts[:ui_class] = Vagrant::UI::Basic + # Cygwin always reports STDOUT is not a TTY, so we only disable + # colors if its not a TTY AND its not Cygwin. + opts[:ui_class] = Vagrant::UI::Basic end # Also allow users to force colors. diff --git a/lib/vagrant/util/platform.rb b/lib/vagrant/util/platform.rb index a0902dd2c..3382f2e69 100644 --- a/lib/vagrant/util/platform.rb +++ b/lib/vagrant/util/platform.rb @@ -85,10 +85,7 @@ module Vagrant # Returns a boolean noting whether the terminal supports color. # output. def terminal_supports_colors? - if windows? - return ENV.has_key?("ANSICON") || cygwin? - end - + return ENV.has_key?("ANSICON") || cygwin? if windows? true end