Handle the case where ctrl-D is pressed on input.

This commit is contained in:
Mitchell Hashimoto 2012-07-11 18:30:37 -07:00
parent e92fbb4d33
commit a34801588c
1 changed files with 5 additions and 2 deletions

View File

@ -73,8 +73,11 @@ module Vagrant
# Output the data
say(:info, message, opts)
# Get the results and chomp off the newline
$stdin.gets.chomp
# Get the results and chomp off the newline. We do a logical OR
# here because `gets` can return a nil, for example in the case
# that ctrl-D is pressed on the input.
input = $stdin.gets || ""
input.chomp
end
# This is used to output progress reports to the UI.