From 8a0e81276e5c852dca4927eafc7a7224e87a27b9 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 5 Jan 2012 23:03:20 -0800 Subject: [PATCH] Don't output color on Windows, since the default terminal doens't support it --- bin/vagrant | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bin/vagrant b/bin/vagrant index b34464e81..fe74153f6 100755 --- a/bin/vagrant +++ b/bin/vagrant @@ -2,6 +2,7 @@ require 'log4r' require 'vagrant' require 'vagrant/cli' +require 'vagrant/util/platform' # Create a logger right away logger = Log4r::Logger.new("vagrant::bin::vagrant") @@ -15,8 +16,10 @@ $stderr.sync = true # environment. opts = {} -# Disable color if the proper argument was passed -if !$stdout.tty? || ARGV.include?("--no-color") +# Disable color if the proper argument was passed or if we're +# on Windows since the default Windows terminal doesn't support +# colors. +if !$stdout.tty? || ARGV.include?("--no-color") || Vagrant::Util::Platform.windows? # Delete the argument from the list so that it doesn't cause any # invalid arguments down the road. ARGV.delete("--no-color")