ssh_tunnels 0.4.1 → 0.4.2
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/Gemfile.lock +1 -1
- data/README.md +4 -0
- data/lib/ssh_tunnels/ui.rb +27 -4
- data/lib/ssh_tunnels/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7bbbe0e2381585ad9d8035fd023bb2417bcac0f26c2a14afb3447186840b0fb3
|
|
4
|
+
data.tar.gz: 8fdf3c1c6d59dd7a26d4b5a6eb5214b9092acae1b01ad455938606aa5f8d303c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 15fc0aa0bc8331899e0db46f07b2fd714947f759f020c4c2ca66e4c5179b9a74368c774635fdd933707dfa9fe054b0900a7ac92690e57d69a85aa329fadfa28b
|
|
7
|
+
data.tar.gz: 4a9db83822c7538422e6952df1fececfde9381bada0159c6317312c173682b4576ecb602b14ce69df91fb70818a72a7c566bbfceee09626276ee99f46da691db
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -117,6 +117,10 @@ The configuration file is checked once a second while the app is running. Saving
|
|
|
117
117
|
|
|
118
118
|
Anything written to the standard error stream while the app is running (a backtrace from a failed connection, for example) is captured and shown below the tunnel list. Press `Esc` to clear it. Only the most recent output is kept.
|
|
119
119
|
|
|
120
|
+
## Redrawing the screen
|
|
121
|
+
|
|
122
|
+
Press `Esc` (or `Ctrl-L`) to clear and redraw the screen if stray characters appear. `Esc` also clears any error output. The screen is redrawn automatically when the terminal is resized.
|
|
123
|
+
|
|
120
124
|
## Contributing
|
|
121
125
|
|
|
122
126
|
Pull requests are welcome.
|
data/lib/ssh_tunnels/ui.rb
CHANGED
|
@@ -14,6 +14,7 @@ module SshTunnels
|
|
|
14
14
|
yellow: Curses::COLOR_YELLOW
|
|
15
15
|
}.freeze
|
|
16
16
|
ESCAPE = [27, "\e"].freeze
|
|
17
|
+
REDRAW = [12, "\f", Curses::KEY_RESIZE].freeze
|
|
17
18
|
|
|
18
19
|
def initialize(config, user, passphrase)
|
|
19
20
|
@config = config
|
|
@@ -150,9 +151,9 @@ module SshTunnels
|
|
|
150
151
|
end
|
|
151
152
|
|
|
152
153
|
def usage_message
|
|
153
|
-
return "No tunnels configured. Press 'q' to quit." if @tunnels.empty?
|
|
154
|
+
return "No tunnels configured. Esc to redraw. Press 'q' to quit." if @tunnels.empty?
|
|
154
155
|
|
|
155
|
-
"[1-#{IDENTIFIERS[@tunnels.size - 1]}] to connect/disconnect. Press 'q' to quit."
|
|
156
|
+
"[1-#{IDENTIFIERS[@tunnels.size - 1]}] to connect/disconnect. Esc to redraw. Press 'q' to quit."
|
|
156
157
|
end
|
|
157
158
|
|
|
158
159
|
# Output captured from the standard error stream (a backtrace, usually) is
|
|
@@ -190,8 +191,7 @@ module SshTunnels
|
|
|
190
191
|
end
|
|
191
192
|
|
|
192
193
|
def process_input(input)
|
|
193
|
-
|
|
194
|
-
return @stderr_capture.clear if ESCAPE.include?(input)
|
|
194
|
+
return if command?(input)
|
|
195
195
|
return status("Unrecognized input: #{input}") unless input.is_a?(String) && input =~ /\A[0-9a-zA-Z]\Z/
|
|
196
196
|
|
|
197
197
|
index = IDENTIFIERS.index(input)
|
|
@@ -201,6 +201,29 @@ module SshTunnels
|
|
|
201
201
|
toggle_tunnel(tunnel)
|
|
202
202
|
end
|
|
203
203
|
|
|
204
|
+
# Handles keys that are not tunnel identifiers. Returns true if handled.
|
|
205
|
+
def command?(input)
|
|
206
|
+
raise UserQuit if input == 'q'
|
|
207
|
+
|
|
208
|
+
if ESCAPE.include?(input)
|
|
209
|
+
@stderr_capture.clear
|
|
210
|
+
redraw
|
|
211
|
+
elsif REDRAW.include?(input)
|
|
212
|
+
redraw
|
|
213
|
+
else
|
|
214
|
+
return false
|
|
215
|
+
end
|
|
216
|
+
true
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
# Clearing the window makes the next refresh repaint the whole terminal,
|
|
220
|
+
# removing stray characters left behind by a resize or by output written
|
|
221
|
+
# directly to the terminal. The next loop iteration draws everything again.
|
|
222
|
+
def redraw
|
|
223
|
+
window.clear
|
|
224
|
+
@status_time = nil
|
|
225
|
+
end
|
|
226
|
+
|
|
204
227
|
def toggle_tunnel(tunnel)
|
|
205
228
|
status("#{tunnel.active? ? 'Disconnecting' : 'Connecting'}: #{tunnel}")
|
|
206
229
|
tunnel.toggle
|
data/lib/ssh_tunnels/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ssh_tunnels
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.4.
|
|
4
|
+
version: 0.4.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Bob Farrell
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-12-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bcrypt_pbkdf
|