ruby-shell 3.6.17 → 3.6.19

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/bin/rsh +21 -8
  3. metadata +3 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 47a8896d9151658c431c1f2302f18b0d143887c9fe67d410a64d9c18bd143347
4
- data.tar.gz: 230a1b7784618c69c860d169e36be458a09509d66052cd3350e1bb6e16620908
3
+ metadata.gz: 6a7f4341f245a647d8c45ea36e67f17af871a3dd8dd67b0344257b152d7284ab
4
+ data.tar.gz: 3a5ec017025daf61f39070689728ef14b787a47964084058be21279b2ef9f795
5
5
  SHA512:
6
- metadata.gz: 1c841a0dc5675dbd5bf1bb9341b0f9edeead426cec47357a2e1655dc1d67465732822a596d71468a5972f511c2a6f0f2f983ee19ed24317567de6b05affef665
7
- data.tar.gz: 61c8fb056e30ad6eba62bca87be4d4d60da8817fb69acee4924d672fa32dcd8f050250a7accae2af6bb288de43907b06c95b38956980af53cdf205c437952f28
6
+ metadata.gz: 1757bf42491dbde8d205d2756d8c3f41fba9dca3145e523d573ad40c6ffed4009ec35774f56da340936e8ddb71b7ebf53b6da366610a7564a296e08859a4a632
7
+ data.tar.gz: 302631f9c4d365913bdb796179d8dcb2e67f45038230470d2ba3500e7d2f8606bee41543dfa35f4c87077150472327f7a9a156effc32435044809af9e15c4038
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.17" # Optimize core input loop
11
+ @version = "3.6.19" # Fix nick deletion and hyphenated command handling
12
12
 
13
13
  # MODULES, CLASSES AND EXTENSIONS
14
14
  class String # Add coloring to strings (with escaping for Readline)
@@ -562,9 +562,18 @@ def getstr # A custom Readline-like function
562
562
  end
563
563
  end
564
564
  lift = true
565
- when 'C-Y' # Copy command line to primary selection
566
- IO.popen('xclip', 'w') { |io| io.write(@history[0]) }
567
- puts "\n#{Time.now.strftime("%H:%M:%S")}: Copied to primary selection (paste with middle buttoni)".c(@c_stamp)
565
+ when 'C-Y' # Copy to clipboard
566
+ if @history[0].empty? && @history[1]
567
+ # Empty line: copy last command to clipboard
568
+ IO.popen('xclip -selection clipboard', 'w') { |io| io.write(@history[1]) } rescue nil
569
+ IO.popen('xclip -selection primary', 'w') { |io| io.write(@history[1]) } rescue nil
570
+ puts "\n#{Time.now.strftime("%H:%M:%S")}: Last command copied to clipboard".c(@c_stamp)
571
+ else
572
+ # Non-empty line: copy current line to clipboard
573
+ IO.popen('xclip -selection clipboard', 'w') { |io| io.write(@history[0]) } rescue nil
574
+ IO.popen('xclip -selection primary', 'w') { |io| io.write(@history[0]) } rescue nil
575
+ puts "\n#{Time.now.strftime("%H:%M:%S")}: Copied to clipboard".c(@c_stamp)
576
+ end
568
577
  when 'C-Z' # Suspend current process (background job)
569
578
  if @current_pid
570
579
  puts "\n[#{@job_id}] Suspended #{@current_pid}"
@@ -1522,7 +1531,10 @@ def rshrc # Write user configuration to .rshrc (portable between machines)
1522
1531
  if conf =~ /@nick\s*=\s*(\{.*?\})/m
1523
1532
  begin
1524
1533
  file_nicks = eval($1)
1525
- @nick = file_nicks.merge(@nick) if file_nicks.is_a?(Hash)
1534
+ if file_nicks.is_a?(Hash)
1535
+ file_nicks.reject! { |k, _| @deleted_nicks&.include?(k) }
1536
+ @nick = file_nicks.merge(@nick)
1537
+ end
1526
1538
  rescue SyntaxError, StandardError
1527
1539
  # If eval fails, keep current @nick
1528
1540
  end
@@ -1819,8 +1831,9 @@ def nick(nick_str = nil) # Define a new nick like this: `:nick "ls = ls --color
1819
1831
  puts "Imported #{imported.length} nicks"
1820
1832
  rshrc
1821
1833
  elsif nick_str.match(/^\s*-/)
1822
- source = nick_str.sub(/^\s*-/, '')
1834
+ source = nick_str.sub(/^\s*-/, '').strip
1823
1835
  if @nick.delete(source)
1836
+ (@deleted_nicks ||= []) << source
1824
1837
  puts "Nick '#{source}' deleted"
1825
1838
  rshrc
1826
1839
  else
@@ -3814,9 +3827,9 @@ loop do
3814
3827
  used_param_nick = first_cmd && @nick[first_cmd] && @nick[first_cmd].include?('{{')
3815
3828
 
3816
3829
  # Do nick/gnick substitution
3817
- ca = @nick.transform_keys {|k| /((^\K\s*\K)|(\|\K\s*\K))\b(?<!-)#{Regexp.escape k}\b/}
3830
+ ca = @nick.transform_keys {|k| /((^\K\s*\K)|(\|\K\s*\K))\b(?<!-)#{Regexp.escape k}\b(?!-)/}
3818
3831
  @cmd = @cmd.gsub(Regexp.union(ca.keys), @nick)
3819
- ga = @gnick.transform_keys {|k| /\b(?<!-)#{Regexp.escape k}\b/}
3832
+ ga = @gnick.transform_keys {|k| /\b(?<!-)#{Regexp.escape k}\b(?!-)/}
3820
3833
  @cmd = @cmd.gsub(Regexp.union(ga.keys), @gnick)
3821
3834
 
3822
3835
  # Expand placeholders if parametrized nick was used
metadata CHANGED
@@ -1,19 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-shell
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.6.17
4
+ version: 3.6.19
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-23 00:00:00.000000000 Z
11
+ date: 2026-03-25 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.17: Optimize core input loop with cached syntax highlighting and math-based
16
- scroll detection.'
15
+ v3.6.18: Fix nick deletion persistence and hyphenated command substitution.'
17
16
  email: g@isene.com
18
17
  executables:
19
18
  - rsh