consolle 0.3.0 → 0.3.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/.version +1 -1
- data/Gemfile.lock +1 -1
- data/lib/consolle/server/console_supervisor.rb +28 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8cbcbc211408bd181f9bb30dc1e20ad0c4798fd3501b4b5b5e4e157c1ed63850
|
|
4
|
+
data.tar.gz: 71770bb16b893aa72b3c72edd8fff3f0f21c56596e7c1eac914b3f1981e1d8dd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 37f73c3bccdb446557479ea5bbccd40bf70d9b95d306d49fd6f997911183b61cffb1042625953991b52fc99a383857090dc2170d24b13720adbb112b284b3886
|
|
7
|
+
data.tar.gz: e8d66da8e20ee744762ae50bc9f7b43d4a56be28bef75ace9a7e8737cd6e3491420a615120b798d118fbe97a1fb30e0918353c26053a036fe8186770bb5b7bf3
|
data/.version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.3.
|
|
1
|
+
0.3.2
|
data/Gemfile.lock
CHANGED
|
@@ -123,6 +123,13 @@ module Consolle
|
|
|
123
123
|
chunk = @reader.read_nonblock(4096)
|
|
124
124
|
output << chunk
|
|
125
125
|
|
|
126
|
+
# Respond to cursor position request during command execution
|
|
127
|
+
if chunk.include?("\e[6n")
|
|
128
|
+
logger.debug "[ConsoleSupervisor] Detected cursor position request during eval, sending response"
|
|
129
|
+
@writer.write("\e[1;1R")
|
|
130
|
+
@writer.flush
|
|
131
|
+
end
|
|
132
|
+
|
|
126
133
|
# Check if we got prompt back
|
|
127
134
|
clean = strip_ansi(output)
|
|
128
135
|
if clean.match?(PROMPT_PATTERN)
|
|
@@ -318,6 +325,13 @@ module Consolle
|
|
|
318
325
|
chunk = @reader.read_nonblock(4096)
|
|
319
326
|
output << chunk
|
|
320
327
|
marker_found = output.include?(marker)
|
|
328
|
+
|
|
329
|
+
# Respond to cursor position request during initialization
|
|
330
|
+
if chunk.include?("\e[6n")
|
|
331
|
+
logger.debug "[ConsoleSupervisor] Detected cursor position request during init, sending response"
|
|
332
|
+
@writer.write("\e[1;1R")
|
|
333
|
+
@writer.flush
|
|
334
|
+
end
|
|
321
335
|
rescue IO::WaitReadable
|
|
322
336
|
IO.select([@reader], nil, nil, 0.1)
|
|
323
337
|
rescue Errno::EIO
|
|
@@ -420,6 +434,13 @@ module Consolle
|
|
|
420
434
|
last_data_time = Time.now
|
|
421
435
|
logger.debug "[ConsoleSupervisor] Got chunk: #{chunk.inspect}"
|
|
422
436
|
|
|
437
|
+
# Respond to cursor position request (ESC[6n)
|
|
438
|
+
if chunk.include?("\e[6n")
|
|
439
|
+
logger.debug "[ConsoleSupervisor] Detected cursor position request, sending response"
|
|
440
|
+
@writer.write("\e[1;1R") # Report cursor at position 1,1
|
|
441
|
+
@writer.flush
|
|
442
|
+
end
|
|
443
|
+
|
|
423
444
|
clean = strip_ansi(output)
|
|
424
445
|
# Check each line for prompt pattern
|
|
425
446
|
clean.lines.each do |line|
|
|
@@ -442,7 +463,13 @@ module Consolle
|
|
|
442
463
|
3.times do |i|
|
|
443
464
|
begin
|
|
444
465
|
loop do
|
|
445
|
-
@reader.read_nonblock(4096)
|
|
466
|
+
chunk = @reader.read_nonblock(4096)
|
|
467
|
+
# Respond to cursor position request even while clearing buffer
|
|
468
|
+
if chunk.include?("\e[6n")
|
|
469
|
+
logger.debug "[ConsoleSupervisor] Detected cursor position request during clear_buffer, sending response"
|
|
470
|
+
@writer.write("\e[1;1R")
|
|
471
|
+
@writer.flush
|
|
472
|
+
end
|
|
446
473
|
end
|
|
447
474
|
rescue IO::WaitReadable, Errno::EIO
|
|
448
475
|
# Buffer cleared for this iteration
|