From 7f2fe524b3a69d05d8a032a52cfaa46f5c8bbe8b Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 5 Mar 2014 10:19:53 -0800 Subject: [PATCH] core: use default color by default (not white) --- lib/vagrant/plugin/v2/command.rb | 2 +- lib/vagrant/ui.rb | 2 +- test/unit/vagrant/ui_test.rb | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/vagrant/plugin/v2/command.rb b/lib/vagrant/plugin/v2/command.rb index 146e502ac..2b0248b62 100644 --- a/lib/vagrant/plugin/v2/command.rb +++ b/lib/vagrant/plugin/v2/command.rb @@ -188,7 +188,7 @@ module Vagrant machines.reverse! if options[:reverse] # Go through each VM and yield it! - color_order = [:white] + color_order = [:default] color_index = 0 machines.each do |machine| diff --git a/lib/vagrant/ui.rb b/lib/vagrant/ui.rb index 221913492..c6dec9078 100644 --- a/lib/vagrant/ui.rb +++ b/lib/vagrant/ui.rb @@ -323,7 +323,7 @@ module Vagrant # is bolded. bold = !!opts[:bold] colorseq = "#{bold ? 1 : 0 }" - if opts[:color] + if opts[:color] && opts[:color] != :default color = COLORS[opts[:color]] colorseq += ";#{color}" end diff --git a/test/unit/vagrant/ui_test.rb b/test/unit/vagrant/ui_test.rb index fed518da1..c7c75d158 100644 --- a/test/unit/vagrant/ui_test.rb +++ b/test/unit/vagrant/ui_test.rb @@ -114,6 +114,11 @@ describe Vagrant::UI::Colored do subject.output("foo") end + it "doesn't use a color if default color" do + subject.should_receive(:safe_puts).with("\033[0mfoo\033[0m", anything) + subject.output("foo", color: :default) + end + it "bolds output without color if specified" do subject.should_receive(:safe_puts).with("\033[1mfoo\033[0m", anything) subject.output("foo", bold: true)