net-ssh-cli 1.8.0 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/net/ssh/cli/version.rb +1 -1
- data/lib/net/ssh/cli.rb +21 -2
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe1c60d30e59f8fc15074b0a59f9a0c868f47472df17d1ad156c301b3582bc22
|
4
|
+
data.tar.gz: bd9f7a6dd71fb3429440f2fd6713d7f04322aba58705bd63d474156a7932cf00
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c81d16a0fd072fea7563c55aaae2bbd0f17622ff27294ec080c14084cf11a106a6bbadb7aeb6516aab8cbb5e35ee8a8be501b33f45f0ed8afff5e0fbb36a08dd
|
7
|
+
data.tar.gz: 8f27e6a09b431191571d90d360486a4141c3b314bf291b948fe401737049e6deebfdd25d8aeaeb830cdeb8727074ae628880c03ea3987f988775a349958c31f8
|
data/lib/net/ssh/cli/version.rb
CHANGED
data/lib/net/ssh/cli.rb
CHANGED
@@ -64,6 +64,12 @@ module Net
|
|
64
64
|
background_processing: false, # default false, whether the process method maps to the underlying net_ssh#process or the net_ssh#process happens in a separate loop
|
65
65
|
on_stdout_processing: 100, # whether to optimize the on_stdout performance by calling #process #optimize_on_stdout-times in case more data arrives
|
66
66
|
sleep_procs: ActiveSupport::HashWithIndifferentAccess.new, # procs to call instead of Kernel.sleep(), perfect for async hooks
|
67
|
+
terminal_chars_width: 320, # Sets and sends the terminal dimensions during the opening of the channel. It does not send a channel_request on change.
|
68
|
+
terminal_chars_height: 120, # See also https://github.com/net-ssh/net-ssh/blob/master/lib/net/ssh/connection/channel.rb#L220 section 'def request_pty'
|
69
|
+
terminal_pixels_width: 1920, # See also https://www.ietf.org/rfc/rfc4254.txt section pty-req and section window-change
|
70
|
+
terminal_pixels_height: 1080, #
|
71
|
+
terminal_term: nil, # Sets the terminal term, usually xterm
|
72
|
+
terminal_modes: nil, #
|
67
73
|
)
|
68
74
|
|
69
75
|
def options
|
@@ -99,7 +105,9 @@ module Net
|
|
99
105
|
|
100
106
|
OPTIONS.keys.select {|key| key.to_s.include? "procs"}.each do |name|
|
101
107
|
define_method name.sub("_procs","") do |&blk|
|
102
|
-
|
108
|
+
id = SecureRandom.uuid
|
109
|
+
self.send(name)[id] = Proc.new {blk.call}
|
110
|
+
id
|
103
111
|
end
|
104
112
|
end
|
105
113
|
|
@@ -375,7 +383,7 @@ module Net
|
|
375
383
|
net_ssh.open_channel do |new_channel|
|
376
384
|
logger.debug 'channel is open'
|
377
385
|
self.channel = new_channel
|
378
|
-
new_channel.request_pty do |_ch, success|
|
386
|
+
new_channel.request_pty(terminal_options) do |_ch, success|
|
379
387
|
raise Error::Pty, "#{host || ip} Failed to open ssh pty" unless success
|
380
388
|
end
|
381
389
|
new_channel.send_channel_request('shell') do |_ch, success|
|
@@ -428,6 +436,17 @@ module Net
|
|
428
436
|
ensure
|
429
437
|
self.process_count -= 1
|
430
438
|
end
|
439
|
+
|
440
|
+
def terminal_options
|
441
|
+
{
|
442
|
+
term: terminal_term,
|
443
|
+
chars_wide: terminal_chars_width,
|
444
|
+
chars_high: terminal_chars_height,
|
445
|
+
pixels_wide: terminal_pixels_width,
|
446
|
+
pixels_high: terminal_pixels_height,
|
447
|
+
modes: terminal_modes
|
448
|
+
}.reject {|k,v| v.nil?}
|
449
|
+
end
|
431
450
|
end
|
432
451
|
end
|
433
452
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: net-ssh-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fabian Stillhart
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-09-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -125,7 +125,7 @@ homepage: https://github.com/swisscom/net-ssh-cli
|
|
125
125
|
licenses:
|
126
126
|
- MIT
|
127
127
|
metadata: {}
|
128
|
-
post_install_message:
|
128
|
+
post_install_message:
|
129
129
|
rdoc_options: []
|
130
130
|
require_paths:
|
131
131
|
- lib
|
@@ -140,8 +140,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
140
140
|
- !ruby/object:Gem::Version
|
141
141
|
version: '0'
|
142
142
|
requirements: []
|
143
|
-
rubygems_version: 3.2.
|
144
|
-
signing_key:
|
143
|
+
rubygems_version: 3.2.24
|
144
|
+
signing_key:
|
145
145
|
specification_version: 4
|
146
146
|
summary: 'Net::SSH::CLI: A library to handle CLI Sessions'
|
147
147
|
test_files: []
|