diff --git a/bin/vagrant b/bin/vagrant index ae682e72e..00daf0339 100755 --- a/bin/vagrant +++ b/bin/vagrant @@ -43,8 +43,16 @@ begin "\n" + "This message will be removed when this version is officially released.", :prefix => false) - result = env.ui.ask("If you're sure you'd like to continue, type 'Y' and then enter: ") - exit 0 if result && result.upcase != "Y" + result = nil + begin + result = env.ui.ask("If you're sure you'd like to continue, type 'Y' and then enter: ") + rescue Interrupt + result = nil + rescue Vagrant::Errors::UIExpectsTTY + result = nil + end + + exit 0 if !result || result.upcase != "Y" # Load the environment logger.debug("Loading environment") diff --git a/plugins/commands/destroy/command.rb b/plugins/commands/destroy/command.rb index 4ffa55395..9c18dafae 100644 --- a/plugins/commands/destroy/command.rb +++ b/plugins/commands/destroy/command.rb @@ -29,6 +29,7 @@ module VagrantPlugins do_destroy = true else choice = nil + begin choice = @env.ui.ask(I18n.t("vagrant.commands.destroy.confirmation", :name => vm.name)) @@ -41,6 +42,7 @@ module VagrantPlugins # means the same thing. raise Vagrant::Errors::DestroyRequiresForce end + do_destroy = choice.upcase == "Y" end