communicators/ssh: pty can be enabled
This commit is contained in:
parent
4bc4317607
commit
6baab10df4
|
@ -287,6 +287,16 @@ module VagrantPlugins
|
||||||
|
|
||||||
# Open the channel so we can execute or command
|
# Open the channel so we can execute or command
|
||||||
channel = connection.open_channel do |ch|
|
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, _|
|
ch.exec(shell_cmd) do |ch2, _|
|
||||||
# Setup the channel callbacks so we can get data and exit status
|
# Setup the channel callbacks so we can get data and exit status
|
||||||
ch2.on_data do |ch3, data|
|
ch2.on_data do |ch3, data|
|
||||||
|
|
|
@ -11,6 +11,7 @@ module VagrantPlugins
|
||||||
attr_accessor :keep_alive
|
attr_accessor :keep_alive
|
||||||
attr_accessor :shell
|
attr_accessor :shell
|
||||||
attr_accessor :proxy_command
|
attr_accessor :proxy_command
|
||||||
|
attr_accessor :pty
|
||||||
|
|
||||||
attr_reader :default
|
attr_reader :default
|
||||||
|
|
||||||
|
@ -22,6 +23,7 @@ module VagrantPlugins
|
||||||
@guest_port = UNSET_VALUE
|
@guest_port = UNSET_VALUE
|
||||||
@keep_alive = UNSET_VALUE
|
@keep_alive = UNSET_VALUE
|
||||||
@proxy_command = UNSET_VALUE
|
@proxy_command = UNSET_VALUE
|
||||||
|
@pty = UNSET_VALUE
|
||||||
@shell = UNSET_VALUE
|
@shell = UNSET_VALUE
|
||||||
|
|
||||||
@default = SSHConnectConfig.new
|
@default = SSHConnectConfig.new
|
||||||
|
@ -42,6 +44,7 @@ module VagrantPlugins
|
||||||
@guest_port = nil if @guest_port == UNSET_VALUE
|
@guest_port = nil if @guest_port == UNSET_VALUE
|
||||||
@keep_alive = false if @keep_alive == UNSET_VALUE
|
@keep_alive = false if @keep_alive == UNSET_VALUE
|
||||||
@proxy_command = nil if @proxy_command == UNSET_VALUE
|
@proxy_command = nil if @proxy_command == UNSET_VALUE
|
||||||
|
@pty = false if @pty == UNSET_VALUE
|
||||||
@shell = nil if @shell == UNSET_VALUE
|
@shell = nil if @shell == UNSET_VALUE
|
||||||
|
|
||||||
@default.finalize!
|
@default.finalize!
|
||||||
|
|
Loading…
Reference in New Issue