net-ssh-cli 1.8.0 → 1.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e3557b2b202abb2f722b950d3f16d0e1c36a57716289f138d4c7f04edb453546
4
- data.tar.gz: 8e58d5fa7d2e89021ffcb10751fff17526542d1d16314f79769f7e5f67451ea0
3
+ metadata.gz: fe1c60d30e59f8fc15074b0a59f9a0c868f47472df17d1ad156c301b3582bc22
4
+ data.tar.gz: bd9f7a6dd71fb3429440f2fd6713d7f04322aba58705bd63d474156a7932cf00
5
5
  SHA512:
6
- metadata.gz: 447b6ac1b58038620c3886241352e48bf5b89cbe0512a9506e08ab359378f62d3629f0007516bbcf4c360e204ea259d865d65e6396ee66d5d10c8c05275ede08
7
- data.tar.gz: a898d86bf7d7fdde7977bd6161e1801606da032b96e3fb04ba6c55a6e104d1d2db0e8f68b12763afb63fee036c19e3c087af203563323543d4328a5fb61c487d
6
+ metadata.gz: c81d16a0fd072fea7563c55aaae2bbd0f17622ff27294ec080c14084cf11a106a6bbadb7aeb6516aab8cbb5e35ee8a8be501b33f45f0ed8afff5e0fbb36a08dd
7
+ data.tar.gz: 8f27e6a09b431191571d90d360486a4141c3b314bf291b948fe401737049e6deebfdd25d8aeaeb830cdeb8727074ae628880c03ea3987f988775a349958c31f8
@@ -3,7 +3,7 @@
3
3
  module Net
4
4
  module SSH
5
5
  module CLI
6
- VERSION = '1.8.0'
6
+ VERSION = '1.9.0'
7
7
  end
8
8
  end
9
9
  end
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
- self.send(name)[SecureRandom.uuid] = Proc.new {blk.call}
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.8.0
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-04-19 00:00:00.000000000 Z
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.15
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: []