rtfm-filemanager 7.3.0 → 7.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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/bin/rtfm +35 -13
  3. metadata +5 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 70adf5224517b9f2cf7a0ec8150c350c3a9b3c6455a6db26781a2ef33dfa385d
4
- data.tar.gz: f07222ba0ed09b855fab399be1209a539efde052a416d48050e82db4c4b42f43
3
+ metadata.gz: 9ad1d9581fc33576497a4af185ce404251e71e1df5e6f080cf19b3e29fb8eb41
4
+ data.tar.gz: 2007300af7b17fdb161c2510f6d8594a169e5f7001f7ff0e17d73524e8bded4b
5
5
  SHA512:
6
- metadata.gz: ef7ce1ea7725333321bddb1b1cbf68300e3c1c697540c7c0b6a0d4f0f4021b7f1a6c408716e4aa2348938b8de555444304a292f886d770ec38df43cca8b145cc
7
- data.tar.gz: 5a4f701cd40e6375387198e2febe6bd56a59976e261b0dd226c0efa53cf21c107a3639cb602993791bc9e7ef0c8396b0d045957810b0dbc6496b1cbcadc63151
6
+ metadata.gz: fb256db6d25e7b19474f425282c5d2d012cd2380bff08bb5e78665aed9c4f2dd5ebdf416c2e13cabe5a78ef446e68b3bbc6d587e5f81a7bffa68d7fcd24a105d
7
+ data.tar.gz: b3972f6e8a57d02478384b65b83a5ee3222b633a37cf10381511b0b50dbc838e9dbd6df00d3872c937ad1aa94dbceaee489d944ac1bbf995ad22e4ac39eed69e
data/bin/rtfm CHANGED
@@ -18,7 +18,7 @@
18
18
  # get a great understanding of the code itself by simply sending
19
19
  # or pasting this whole file into you favorite AI for coding with
20
20
  # a prompt like this: "Help me understand every part of this code".
21
- @version = '7.3.0' # Modern image display using termpix gem
21
+ @version = '7.3.2' # Image persistence and C-Y copies images
22
22
 
23
23
  # SAVE & STORE TERMINAL {{{1
24
24
  ORIG_STTY = `stty -g`.chomp
@@ -290,7 +290,7 @@ CONFIG_FILE = File.join(RTFM_HOME, 'conf')
290
290
  CLIPBOARD COPY
291
291
  y = Copy path of selected item to primary selection (for pasting with middle mouse button)
292
292
  Y = Copy path of selected item to clipboard
293
- Ctrl-y = Copy content of right pane to clipboard
293
+ Ctrl-y = Copy content of right pane to clipboard (images: copies image file, text: copies text)
294
294
  Turn off batcat syntax highlighting with 'b' for a clean copy of content
295
295
 
296
296
  SYSTEM SHORTCUTS
@@ -1049,8 +1049,8 @@ def getkey # {{{3
1049
1049
 
1050
1050
  return unless chr
1051
1051
 
1052
- showimage('clear') if @image
1053
- @image = false
1052
+ # Don't clear image here - let render system handle it when @pR.update is true
1053
+ # This preserves images during operations that don't change the selected item
1054
1054
  if handler = KEYMAP[chr] # rubocop:disable Lint/AssignmentInCondition
1055
1055
  m = method(handler)
1056
1056
  m.arity == 1 ? m.call(chr) : m.call
@@ -3945,10 +3945,32 @@ def get_selected_full_path # {{{3
3945
3945
  end
3946
3946
 
3947
3947
  def copy_right # {{{3
3948
- clip = 'xclip -selection clipboard'
3949
- @pB.say(' Right pane copied to clipboard')
3950
- # We drop the trailing & in the string itself…
3951
- shell("echo -n #{Shellwords.escape(@pR.text.pure)} | #{clip} > /dev/null 2>&1", background: true)
3948
+ if @image && @selected && @selected.match(@imagefile)
3949
+ # Copy the image file to clipboard
3950
+ escaped_path = Shellwords.escape(@selected)
3951
+ # Detect image type from extension
3952
+ ext = File.extname(@selected).downcase
3953
+ mime_type = case ext
3954
+ when '.png' then 'image/png'
3955
+ when '.jpg', '.jpeg' then 'image/jpeg'
3956
+ when '.gif' then 'image/gif'
3957
+ when '.bmp' then 'image/bmp'
3958
+ when '.webp' then 'image/webp'
3959
+ else 'image/png'
3960
+ end
3961
+
3962
+ # Use cat to pipe file contents to xclip
3963
+ if system("cat #{escaped_path} | xclip -selection clipboard -target #{mime_type} 2>/dev/null")
3964
+ @pB.say(' Image copied to clipboard')
3965
+ else
3966
+ @pB.say(' Failed to copy image - xclip may not be installed')
3967
+ end
3968
+ else
3969
+ # Copy right pane text content
3970
+ clip = 'xclip -selection clipboard'
3971
+ @pB.say(' Right pane text copied to clipboard')
3972
+ shell("echo -n #{Shellwords.escape(@pR.text.pure)} | #{clip} > /dev/null 2>&1", background: true)
3973
+ end
3952
3974
  end
3953
3975
 
3954
3976
  # SYSTEM SHORTCUTS {{{2
@@ -5641,18 +5663,18 @@ def showimage(image) # SHOW THE SELECTED IMAGE IN THE RIGHT WINDOW {{{2
5641
5663
  if image == 'clear'
5642
5664
  @termpix.clear(
5643
5665
  x: @pR.x,
5644
- y: @pR.y,
5645
- width: @pR.w,
5646
- height: @pR.h,
5666
+ y: 2,
5667
+ width: @pR.w - 1,
5668
+ height: @pR.h - 1,
5647
5669
  term_width: @w,
5648
5670
  term_height: @h)
5649
5671
  @current_image_path = nil
5650
5672
  else
5651
- # Display image using termpix
5673
+ # Display image using termpix (use original absolute row 2)
5652
5674
  img_path = File.absolute_path(image)
5653
5675
  @termpix.show(img_path,
5654
5676
  x: @pR.x,
5655
- y: @pR.y,
5677
+ y: 2,
5656
5678
  max_width: @pR.w - 2,
5657
5679
  max_height: @pR.h - 1)
5658
5680
  @current_image_path = img_path
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rtfm-filemanager
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.3.0
4
+ version: 7.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geir Isene
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-10-26 00:00:00.000000000 Z
11
+ date: 2025-10-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rcurses
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0.1'
33
+ version: '0.2'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0.1'
40
+ version: '0.2'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bootsnap
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -67,7 +67,7 @@ dependencies:
67
67
  - !ruby/object:Gem::Version
68
68
  version: '7.4'
69
69
  description: |-
70
- RTFM v7.3.0: Modern image display with termpix gem - supports Sixel (mlterm) and w3m protocols.
70
+ RTFM v7.3.2: Image persistence during operations and C-Y copies images to clipboard.
71
71
  A full featured terminal browser with syntax highlighted files, images shown in the terminal, videos thumbnailed, etc. Features include remote SSH/SFTP browsing, interactive SSH shell, comprehensive undo system, bookmarks, and much more. You can bookmark and jump around easily, delete, rename, copy, symlink and move files. RTFM is one of the most feature-packed terminal file managers.
72
72
  email: g@isene.com
73
73
  executables: