diff --git a/Gemfile b/Gemfile index 3ddf8ced5..45e0580d4 100644 --- a/Gemfile +++ b/Gemfile @@ -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 diff --git a/lib/vagrant/action/builtin/ssh_run.rb b/lib/vagrant/action/builtin/ssh_run.rb index 5ca2ef68f..db2a0d79e 100644 --- a/lib/vagrant/action/builtin/ssh_run.rb +++ b/lib/vagrant/action/builtin/ssh_run.rb @@ -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 diff --git a/lib/vagrant/util/ssh.rb b/lib/vagrant/util/ssh.rb index 87efbb3c6..487b972b0 100644 --- a/lib/vagrant/util/ssh.rb +++ b/lib/vagrant/util/ssh.rb @@ -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