communicators/ssh: pty can be enabled

This commit is contained in:
Mitchell Hashimoto 2013-11-24 16:48:07 -08:00
parent 4bc4317607
commit 6baab10df4
2 changed files with 13 additions and 0 deletions

View File

@ -287,6 +287,16 @@ module VagrantPlugins
# Open the channel so we can execute or command
channel = connection.open_channel do |ch|
if @machine.config.ssh.pty
ch.request_pty do |ch2, success|
if success
@logger.debug("pty obtained for connection")
else
@logger.warn("failed to obtain pty, will try to continue anyways")
end
end
end
ch.exec(shell_cmd) do |ch2, _|
# Setup the channel callbacks so we can get data and exit status
ch2.on_data do |ch3, data|

View File

@ -11,6 +11,7 @@ module VagrantPlugins
attr_accessor :keep_alive
attr_accessor :shell
attr_accessor :proxy_command
attr_accessor :pty
attr_reader :default
@ -22,6 +23,7 @@ module VagrantPlugins
@guest_port = UNSET_VALUE
@keep_alive = UNSET_VALUE
@proxy_command = UNSET_VALUE
@pty = UNSET_VALUE
@shell = UNSET_VALUE
@default = SSHConnectConfig.new
@ -42,6 +44,7 @@ module VagrantPlugins
@guest_port = nil if @guest_port == UNSET_VALUE
@keep_alive = false if @keep_alive == UNSET_VALUE
@proxy_command = nil if @proxy_command == UNSET_VALUE
@pty = false if @pty == UNSET_VALUE
@shell = nil if @shell == UNSET_VALUE
@default.finalize!