ruby-shell 3.6.16 → 3.6.17
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/bin/rsh +25 -24
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 47a8896d9151658c431c1f2302f18b0d143887c9fe67d410a64d9c18bd143347
|
|
4
|
+
data.tar.gz: 230a1b7784618c69c860d169e36be458a09509d66052cd3350e1bb6e16620908
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1c841a0dc5675dbd5bf1bb9341b0f9edeead426cec47357a2e1655dc1d67465732822a596d71468a5972f511c2a6f0f2f983ee19ed24317567de6b05affef665
|
|
7
|
+
data.tar.gz: 61c8fb056e30ad6eba62bca87be4d4d60da8817fb69acee4924d672fa32dcd8f050250a7accae2af6bb288de43907b06c95b38956980af53cdf205c437952f28
|
data/bin/rsh
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
# Web_site: http://isene.com/
|
|
9
9
|
# Github: https://github.com/isene/rsh
|
|
10
10
|
# License: Public domain
|
|
11
|
-
@version = "3.6.
|
|
11
|
+
@version = "3.6.17" # Optimize core input loop
|
|
12
12
|
|
|
13
13
|
# MODULES, CLASSES AND EXTENSIONS
|
|
14
14
|
class String # Add coloring to strings (with escaping for Readline)
|
|
@@ -388,38 +388,39 @@ def getstr # A custom Readline-like function
|
|
|
388
388
|
lift = false
|
|
389
389
|
right = false
|
|
390
390
|
|
|
391
|
-
#
|
|
392
|
-
@
|
|
393
|
-
@
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
print @prompt_last_line
|
|
398
|
-
print cmd_check(@history[0])
|
|
391
|
+
# Cache syntax highlighting (skip re-highlighting on cursor-only moves)
|
|
392
|
+
cmd_text = @history[0].to_s
|
|
393
|
+
if cmd_text != @_hl_text
|
|
394
|
+
@_hl_text = cmd_text.dup
|
|
395
|
+
@_hl_result = cmd_check(@history[0])
|
|
396
|
+
end
|
|
399
397
|
|
|
400
|
-
#
|
|
401
|
-
@ci = @history[1..].find_index {|e| e =~ /^#{Regexp.escape(
|
|
398
|
+
# History suggestion lookup
|
|
399
|
+
@ci = @history[1..].find_index {|e| e =~ /^#{Regexp.escape(cmd_text)}./}
|
|
402
400
|
unless @ci == nil
|
|
403
401
|
@ci += 1
|
|
404
|
-
@ciprompt = @history[@ci][
|
|
405
|
-
end
|
|
406
|
-
if @history[0].to_s.length > 1 and @ci
|
|
407
|
-
print @ciprompt.c(@c_stamp)
|
|
408
|
-
right = true
|
|
402
|
+
@ciprompt = @history[@ci][cmd_text.length..].to_s
|
|
409
403
|
end
|
|
404
|
+
right = cmd_text.length > 1 && @ci
|
|
410
405
|
|
|
411
|
-
#
|
|
412
|
-
|
|
413
|
-
printed_len
|
|
414
|
-
printed_len += @ciprompt.to_s.length if right # Include suggestion text
|
|
406
|
+
# Compute scroll adjustment before drawing (avoids terminal round-trip)
|
|
407
|
+
printed_len = @pos0 + cmd_text.length
|
|
408
|
+
printed_len += @ciprompt.to_s.length if right
|
|
415
409
|
expected_rows = printed_len > 0 ? (printed_len - 1) / @maxcol : 0
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
@cmd_row = [actual_start, 1].max # Terminal scrolled; adjust (min row 1)
|
|
410
|
+
if @cmd_row + expected_rows > @maxrow
|
|
411
|
+
@cmd_row = [@maxrow - expected_rows, 1].max
|
|
419
412
|
end
|
|
420
413
|
|
|
414
|
+
# Redraw prompt + command
|
|
415
|
+
@c.row(@cmd_row)
|
|
416
|
+
@c.col(1)
|
|
417
|
+
@c.clear_screen_down
|
|
418
|
+
print @prompt_last_line
|
|
419
|
+
print @_hl_result
|
|
420
|
+
print @ciprompt.c(@c_stamp) if right
|
|
421
|
+
|
|
421
422
|
# Position cursor with wrapping math
|
|
422
|
-
total_pos = @pos0 + @pos
|
|
423
|
+
total_pos = @pos0 + @pos
|
|
423
424
|
cursor_row = @cmd_row + total_pos / @maxcol
|
|
424
425
|
cursor_col = total_pos % @maxcol + 1
|
|
425
426
|
@c.row(cursor_row)
|
metadata
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ruby-shell
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.6.
|
|
4
|
+
version: 3.6.17
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Geir Isene
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-03-
|
|
11
|
+
date: 2026-03-23 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: 'A shell written in Ruby with extensive tab completions, aliases/nicks,
|
|
14
14
|
history, syntax highlighting, theming, auto-cd, auto-opening files and more. UPDATE
|
|
15
|
-
v3.6.
|
|
16
|
-
|
|
15
|
+
v3.6.17: Optimize core input loop with cached syntax highlighting and math-based
|
|
16
|
+
scroll detection.'
|
|
17
17
|
email: g@isene.com
|
|
18
18
|
executables:
|
|
19
19
|
- rsh
|