diff --git a/CHANGELOG.md b/CHANGELOG.md index a42708bc1..fe848fcf2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,8 @@ - FIx issue where puppet would reorder module paths. [GH-964] - Human-friendly error is raised if there are permission issues when using SCP to upload files. [GH-924] + - When console input is asked for (destroying a VM, bridged interfaces, etc.), + keystrokes such as ctrl-D and ctrl-C are more gracefully handled. [GH-1017] ## 1.0.3 (May 1, 2012) diff --git a/plugins/commands/destroy/command.rb b/plugins/commands/destroy/command.rb index d834bf34f..4ffa55395 100644 --- a/plugins/commands/destroy/command.rb +++ b/plugins/commands/destroy/command.rb @@ -32,6 +32,10 @@ module VagrantPlugins begin choice = @env.ui.ask(I18n.t("vagrant.commands.destroy.confirmation", :name => vm.name)) + rescue Interrupt + # Ctrl-C was pressed (or SIGINT). We just exit immediately + # with a non-zero exit status. + return 1 rescue Vagrant::Errors::UIExpectsTTY # We raise a more specific error but one which basically # means the same thing.