diff --git a/CHANGELOG.md b/CHANGELOG.md index 5132ab91f..a6f1d7f0c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ - Chef solo `roles_path` and `data_bags_path` can only be be single paths. [GH-446] - Fix `virtualbox_not_detected` error message to require 4.1.x. [GH-458] - Add shortname (`hostname -s`) for hostname setting on RHEL systems. [GH-456] + - `vagrant ssh -c` output no longer has a prefix and respects newlines + from the output. [GH-462] ## 0.8.2 (July 22, 2011) diff --git a/lib/vagrant/command/ssh.rb b/lib/vagrant/command/ssh.rb index 2e709cfa6..9c56dc020 100644 --- a/lib/vagrant/command/ssh.rb +++ b/lib/vagrant/command/ssh.rb @@ -16,9 +16,12 @@ module Vagrant def ssh_execute ssh_vm.ssh.execute do |ssh| - ssh_vm.env.ui.info I18n.t("vagrant.commands.ssh.command", :command => options[:command]) ssh.exec!(options[:command]) do |channel, type, data| - ssh_vm.env.ui.info "#{data}" + if type != :exit_status + # Print the SSH output as it comes in, but don't prefix it and don't + # force a new line so that the output is properly preserved + ssh_vm.env.ui.info(data.to_s, :prefix => false, :new_line => false) + end end end end diff --git a/lib/vagrant/ui.rb b/lib/vagrant/ui.rb index 9b27cdc7d..638727b17 100644 --- a/lib/vagrant/ui.rb +++ b/lib/vagrant/ui.rb @@ -34,7 +34,9 @@ module Vagrant class_eval <<-CODE def #{method}(message, opts=nil) super(message) - @shell.say("\#{format_message(message, opts)}", #{color.inspect}) + opts ||= {} + opts[:new_line] = true if !opts.has_key?(:new_line) + @shell.say("\#{format_message(message, opts)}", #{color.inspect}, opts[:new_line]) end CODE end diff --git a/templates/locales/en.yml b/templates/locales/en.yml index d26c6f434..773f0377f 100644 --- a/templates/locales/en.yml +++ b/templates/locales/en.yml @@ -185,8 +185,6 @@ en: vm_not_running: "VM is not currently running. Please bring it up to run this command." box: no_installed_boxes: "There are no installed boxes! Use `vagrant box add` to add some." - ssh: - command: "Command: %{command}" status: aborted: |- The VM is in an aborted state. This means that it was abruptly