core: For dev, temporarily use branch of Childprocess, fix Win issue

This commit is contained in:
Mitchell Hashimoto 2014-01-17 09:39:51 -08:00
parent 83245e6b2a
commit 5bc96ad4bf
3 changed files with 4 additions and 19 deletions

View File

@ -2,6 +2,9 @@ source "http://rubygems.org"
gemspec
gem 'childprocess', git: "https://github.com/jarib/childprocess.git",
branch: "windows-inherit-stdin"
if File.exist?(File.expand_path("../../vagrant-spec", __FILE__))
gem 'vagrant-spec', path: "../vagrant-spec"
else

View File

@ -50,12 +50,6 @@ module Vagrant
# don't then we default to a TTY
if !opts[:extra_args].include?("-t") && !opts[:extra_args].include?("-T")
opts[:extra_args] << "-t"
if Util::Platform.windows?
# Windows currently has a bug where STDIN won't be a TTY.
# This absolutely forces the allocation.
opts[:extra_args] << "-t"
end
end
opts[:extra_args] << command

View File

@ -173,20 +173,8 @@ module Vagrant
LOGGER.info("Executing SSH in subprocess: #{command_options.inspect}")
process = ChildProcess.build("ssh", *command_options)
process.io.inherit!
process.duplex = true if Platform.windows?
process.start
if Platform.windows?
# On Windows, we have to mirror the STDIN to the child process.
while true
results = ::IO.select([$stdin], [], [], 0.5)
break if process.exited?
next if results[0].empty?
process.io.stdin.write(IO.read_until_block($stdin))
end
end
process.wait if !process.exited?
process.wait
return process.exit_code
end
end