rtfm-filemanager 6.0.10 → 6.0.12
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/rtfm +48 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f23c3145187f23f9fe272f2c71d8800994d9da6cecd7469076848114235d73ee
|
4
|
+
data.tar.gz: 8e3c2cdfffd409ce6f0ceb5096bf5f1ac93ac70e054e8900d1ac3babd333d83c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 62d243203be50d5e9f42b87781a0b2da754286022c97f6fb1119059c97c750ca90147a361e938d572bfca3cf5ef4ba80b14bd0fbf1b864778d247dde51255740
|
7
|
+
data.tar.gz: 0e7819b401b9173ca52ac69e3c8eca6c1d11072f5d60e2ac631877546f09ab4fcd58a45951b648f178a601a39bff01dc143bafb7015710c0720ad43f21c5106f
|
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.
|
21
|
+
@version = '6.0.12' # Fixed terminal state issue causing multiple keypresses in VIM
|
22
22
|
|
23
23
|
# SAVE & STORE TERMINAL {{{1
|
24
24
|
ORIG_STTY = `stty -g`.chomp
|
@@ -822,11 +822,11 @@ preview_specs = {
|
|
822
822
|
'xls' => "xls2csv @s 2>/dev/null",
|
823
823
|
'ppt' => "catppt @s 2>/dev/null",
|
824
824
|
# images ⇒ nil => call showimage
|
825
|
-
'png, jpg, jpeg, bmp, gif, webp, tif, tiff' => nil,
|
825
|
+
'png, jpg, jpeg, bmp, gif, webp, tif, tiff, svg' => nil,
|
826
826
|
# video ⇒ nil, but detected via pattern below
|
827
827
|
'mpg, mpeg, avi, mov, mkv, mp4' => nil
|
828
828
|
}
|
829
|
-
@imagefile ||= /\.(?:png|jpe?g|bmp|gif|webp|tiff
|
829
|
+
@imagefile ||= /\.(?:png|jpe?g|bmp|gif|webp|tiff?|svg)$/i
|
830
830
|
@pdffile ||= /\.pdf$/i
|
831
831
|
# rubocop:enable Style/StringLiterals
|
832
832
|
|
@@ -5043,6 +5043,8 @@ def open_selected(html = nil) # OPEN SELECTED FILE {{{2
|
|
5043
5043
|
if !@selected&.match(@pdffile) && File.size(@selected) < 1_000_000 && File.read(@selected).force_encoding('UTF-8').valid_encoding? # Pure text
|
5044
5044
|
# Save terminal state before launching editor
|
5045
5045
|
system("stty -g < /dev/tty > /tmp/rtfm_stty_$$")
|
5046
|
+
# Reset terminal to sane/cooked mode for editor
|
5047
|
+
system('stty sane < /dev/tty')
|
5046
5048
|
# Clear and reset terminal for editor
|
5047
5049
|
system('clear < /dev/tty > /dev/tty')
|
5048
5050
|
Cursor.show
|
@@ -5178,6 +5180,49 @@ def showcontent # SHOW CONTENTS IN THE RIGHT WINDOW {{{2
|
|
5178
5180
|
end
|
5179
5181
|
elsif pattern # Nil template → image or video
|
5180
5182
|
case @selected
|
5183
|
+
when /\.svg$/i
|
5184
|
+
# Convert SVG to PNG for display
|
5185
|
+
begin
|
5186
|
+
file_size = File.size(@selected)
|
5187
|
+
if file_size > 50_000_000 # 50MB limit for images
|
5188
|
+
@pR.say("SVG too large for preview (#{(file_size / 1024.0 / 1024.0).round(1)}MB > 50MB limit)")
|
5189
|
+
else
|
5190
|
+
tn = '/tmp/rtfm_svg_preview.png'
|
5191
|
+
# Try direct conversion first
|
5192
|
+
if system("convert #{Shellwords.escape(@selected)} #{Shellwords.escape(tn)} 2>/dev/null")
|
5193
|
+
showimage(tn)
|
5194
|
+
@image = true
|
5195
|
+
else
|
5196
|
+
# If direct conversion fails, try fixing XML entities and retry
|
5197
|
+
temp_svg = '/tmp/rtfm_svg_fixed.svg'
|
5198
|
+
begin
|
5199
|
+
content = File.read(@selected, encoding: 'UTF-8')
|
5200
|
+
# Fix common XML entity issues (replace unescaped ampersands)
|
5201
|
+
# First escape all &, then restore valid entities
|
5202
|
+
fixed_content = content.gsub('&', '&')
|
5203
|
+
.gsub('&amp;', '&')
|
5204
|
+
.gsub('&lt;', '<')
|
5205
|
+
.gsub('&gt;', '>')
|
5206
|
+
.gsub('&quot;', '"')
|
5207
|
+
.gsub('&apos;', ''')
|
5208
|
+
.gsub(/&#(\d+);/, '&#\1;')
|
5209
|
+
.gsub(/&#x([0-9a-fA-F]+);/, '&#x\1;')
|
5210
|
+
File.write(temp_svg, fixed_content)
|
5211
|
+
|
5212
|
+
if system("convert #{Shellwords.escape(temp_svg)} #{Shellwords.escape(tn)} 2>/dev/null")
|
5213
|
+
showimage(tn)
|
5214
|
+
@image = true
|
5215
|
+
else
|
5216
|
+
@pR.say("Error converting SVG to PNG for preview")
|
5217
|
+
end
|
5218
|
+
ensure
|
5219
|
+
File.delete(temp_svg) if File.exist?(temp_svg)
|
5220
|
+
end
|
5221
|
+
end
|
5222
|
+
end
|
5223
|
+
rescue => e
|
5224
|
+
@pR.say("Error processing SVG: #{e}")
|
5225
|
+
end
|
5181
5226
|
when /\.(?:png|jpe?g|bmp|gif|webp|tiff?)$/i
|
5182
5227
|
# Allow larger image files up to 50MB
|
5183
5228
|
begin
|
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.
|
4
|
+
version: 6.0.12
|
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-
|
11
|
+
date: 2025-08-12 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.
|
56
|
+
RTFM v6.0.12: Fixed terminal state issue causing multiple keypresses required in VIM when opening text files.
|
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:
|