rtfm-filemanager 6.0.9 → 6.0.10

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 +21 -5
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3ab0c62999b31e35023b07ee5d03f4d76902f7cc0c6eda5787c45a90fd479b9a
4
- data.tar.gz: 63bcd01728eeb40c448370b25396fbd6f081e6e8923117e8a6e1d944cf3528b0
3
+ metadata.gz: ae2f555bf52ad3f1fcbaa0e110b4f3b4252bf906bee100aa2a4092c6f00b858a
4
+ data.tar.gz: 20f17f27d98841596a0950eef615fd2916811459483ff3b41842f177fc6de640
5
5
  SHA512:
6
- metadata.gz: 9fbab9227b727d0de460099d65b94de1c285b4f8a085ee8e98d4b55125e720c62d54c49e830e82d061d7192c0e927e61347f343b95951e0fedd8581ad0129ca2
7
- data.tar.gz: f7f412f3fa7b6586fa942e7ca63e3620e09d2ab254d2dcbf8ea9ee5bd7805502c94db6f6bd009836c73a330d773bbca3d5123d24f32c07ce61315c57e4b24219
6
+ metadata.gz: 55d86c42f7130b275c0bc467de36f4371269c21e33bef33b6ad4bc7d09fa6d9a21b3b75133525e8c994db7213a98e481cb5f4fc3bba292ce456472851a31120c
7
+ data.tar.gz: 4346e80ddf4a689c083becf9a6cef921fddb57659c192a3ad4e9b82c3a63deefdd74a224ae6e7abae3e5c6660f102255ab890119b571fed634fe2ca0e35954a8
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 = '6.0.9' # Fixed timeout issue for GUI applications launched via command mode
21
+ @version = '6.0.10' # Fixed filename escaping for PDF preview and GUI applications with special characters
22
22
 
23
23
  # SAVE & STORE TERMINAL {{{1
24
24
  ORIG_STTY = `stty -g`.chomp
@@ -4045,8 +4045,19 @@ def command_mode # {{{3
4045
4045
  force = raw.start_with?('§')
4046
4046
  raw = raw[1..].strip if force
4047
4047
  # Expand @s / @t
4048
- sel = Shellwords.escape(@selected.to_s)
4049
- tg = @tagged.map { |p| Shellwords.escape(p) }.join(' ')
4048
+ # Check if this is a GUI application that needs unescaped filenames
4049
+ gui_apps = %w[evince okular xdg-open firefox chromium nautilus thunar dolphin gwenview eog]
4050
+ first_word = raw.split.first
4051
+
4052
+ if gui_apps.include?(first_word)
4053
+ # For GUI apps, quote the filename instead of escaping
4054
+ sel = '"' + @selected.to_s.gsub('"', '\\"') + '"'
4055
+ tg = @tagged.map { |p| '"' + p.gsub('"', '\\"') + '"' }.join(' ')
4056
+ else
4057
+ # For command-line tools, use shell escaping
4058
+ sel = Shellwords.escape(@selected.to_s)
4059
+ tg = @tagged.map { |p| Shellwords.escape(p) }.join(' ')
4060
+ end
4050
4061
  cmd = raw.gsub('@s', sel).gsub('@t', tg)
4051
4062
 
4052
4063
  # Handle cd commands specially
@@ -5153,11 +5164,16 @@ def showcontent # SHOW CONTENTS IN THE RIGHT WINDOW {{{2
5153
5164
  entry = PREVIEW_HANDLERS.find { |re, _| re.match?(@selected) }
5154
5165
  pattern, tmpl = entry || [nil, nil]
5155
5166
  if tmpl # Command-based preview
5156
- escaped = Shellwords.escape(@selected)
5157
5167
  if !@batuse && tmpl.match?(/\b#{@bat}\b/)
5168
+ escaped = Shellwords.escape(@selected)
5158
5169
  showcommand("cat #{escaped}")
5159
5170
  else
5160
- cmd = tmpl.gsub('@s', escaped)
5171
+ # For complex commands with pipes, we need to quote the filename
5172
+ # within the shell command string since it's executed via bash -c
5173
+ # First escape any single quotes in the filename
5174
+ safe_filename = @selected.gsub("'", "'\"'\"'")
5175
+ # Then wrap in single quotes for the shell command
5176
+ cmd = tmpl.gsub('@s', "'#{safe_filename}'")
5161
5177
  showcommand(cmd)
5162
5178
  end
5163
5179
  elsif pattern # Nil template → image or video
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: 6.0.9
4
+ version: 6.0.10
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-07-23 00:00:00.000000000 Z
11
+ date: 2025-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rcurses
@@ -53,7 +53,7 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: '7.4'
55
55
  description: |-
56
- RTFM v6.0.9: Fixed timeout issue for GUI applications launched via command mode (e.g., evince, xdg-open).
56
+ RTFM v6.0.10: Fixed filename escaping for PDF preview and GUI applications with special characters (spaces, parentheses, apostrophes).
57
57
  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.
58
58
  email: g@isene.com
59
59
  executables: