rtfm-filemanager 7.0.5 → 7.0.8
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/README.md +7 -0
- data/bin/rtfm +35 -15
- 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: fe74615d16c35a3df2cd43dc915eac92084b47c5c459a8d55699bfdea8d8901c
|
4
|
+
data.tar.gz: 792b91626ef04bd1afa86056b5937502e344864c3cd33a1713fce86206123118
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 904e4487383b214f68096d13d4a207e3e04bcf6f48262dda18fd364a9846a1549a6c834dc206d939dcbffdbcbc1a9bdb52c40027a705e9d8a1a5485653235cfc
|
7
|
+
data.tar.gz: 5d7599105945ca79638a10b06d9847c1ce0d7b1b977bc2ac26f1bfd4b5c708acb9fac17b82155b4a122a7b559c47809e9d604f51623c74a54f3b480306198990
|
data/README.md
CHANGED
@@ -523,9 +523,16 @@ previewed by default in RTFM. The `preview.rb` explains how you add thesea:
|
|
523
523
|
# # plain text, Ruby, Python, shell
|
524
524
|
# txt, rb, py, sh = bat -n --color=always @s
|
525
525
|
#
|
526
|
+
# # Alternative syntax highlighters (e.g., on macOS without bat)
|
527
|
+
# # txt, rb, py, sh = highlight -O ansi --force --line-numbers @s
|
528
|
+
#
|
526
529
|
# # markdown via pandoc
|
527
530
|
# md = pandoc @s -t plain
|
528
531
|
#
|
532
|
+
# # Alternative markdown viewers (e.g., lowdown, termmark)
|
533
|
+
# # md = lowdown -Tterm @s
|
534
|
+
# # md = termmark @s
|
535
|
+
#
|
529
536
|
# # PDFs
|
530
537
|
# pdf = pdftotext -f 1 -l 4 @s -
|
531
538
|
```
|
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.0.
|
21
|
+
@version = '7.0.8' # Fixed ALL SVG metadata processing to prevent hangs
|
22
22
|
|
23
23
|
# SAVE & STORE TERMINAL {{{1
|
24
24
|
ORIG_STTY = `stty -g`.chomp
|
@@ -1634,13 +1634,15 @@ def undo_delete(operation) # {{{3
|
|
1634
1634
|
if operation[:trash]
|
1635
1635
|
# Restore from trash
|
1636
1636
|
operation[:paths].each do |path_info|
|
1637
|
-
|
1637
|
+
# Use the unique trash name if available (new format), otherwise fallback to basename (old format)
|
1638
|
+
trash_name = path_info[:trash_name] || File.basename(path_info[:path])
|
1639
|
+
source = File.join(TRASH_DIR, trash_name)
|
1638
1640
|
dest = path_info[:path]
|
1639
1641
|
|
1640
1642
|
if File.exist?(source)
|
1641
1643
|
FileUtils.mv(source, dest)
|
1642
1644
|
else
|
1643
|
-
raise "Cannot restore #{path_info[:path]}: not found in trash"
|
1645
|
+
raise "Cannot restore #{path_info[:path]}: not found in trash (looked for #{trash_name})"
|
1644
1646
|
end
|
1645
1647
|
end
|
1646
1648
|
else
|
@@ -3197,7 +3199,7 @@ def delete_items # {{{3
|
|
3197
3199
|
if @trash
|
3198
3200
|
warning_text << "Items will be moved to:\n".fg(249)
|
3199
3201
|
warning_text << " ~/.rtfm/trash/\n".fg(240)
|
3200
|
-
warning_text << "\nYou can restore them with " + "
|
3202
|
+
warning_text << "\nYou can restore them with " + "U".fg(156) + " (undo)\n".fg(249)
|
3201
3203
|
else
|
3202
3204
|
warning_text << "⚠️ WARNING: PERMANENT DELETION!\n".fg(196).b
|
3203
3205
|
warning_text << "Files will be permanently removed\n".fg(196)
|
@@ -3220,18 +3222,27 @@ def delete_items # {{{3
|
|
3220
3222
|
else
|
3221
3223
|
# Record undo information before deletion
|
3222
3224
|
if @trash
|
3225
|
+
# Generate unique trash names to avoid overwriting
|
3226
|
+
timestamp = Time.now.strftime('%Y%m%d_%H%M%S')
|
3227
|
+
trash_mappings = paths.map do |p|
|
3228
|
+
basename = File.basename(p)
|
3229
|
+
# Add timestamp and a random suffix to ensure uniqueness
|
3230
|
+
trash_name = "#{timestamp}_#{basename}_#{rand(1000..9999)}"
|
3231
|
+
trash_path = File.join(TRASH_DIR, trash_name)
|
3232
|
+
{ path: p, trash_name: trash_name, trash_path: trash_path }
|
3233
|
+
end
|
3234
|
+
|
3223
3235
|
undo_info = {
|
3224
3236
|
type: 'delete',
|
3225
3237
|
trash: true,
|
3226
|
-
paths:
|
3238
|
+
paths: trash_mappings.map { |m| { path: m[:path], trash_name: m[:trash_name] } },
|
3227
3239
|
timestamp: Time.now
|
3228
3240
|
}
|
3229
|
-
|
3230
|
-
|
3231
|
-
|
3232
|
-
|
3233
|
-
|
3234
|
-
command("mv -f #{esc} #{esc_trash}")
|
3241
|
+
|
3242
|
+
# Move each file with its unique trash name
|
3243
|
+
trash_mappings.each do |mapping|
|
3244
|
+
command("mv -f #{Shellwords.escape(mapping[:path])} #{Shellwords.escape(mapping[:trash_path])}")
|
3245
|
+
end
|
3235
3246
|
# Only add to undo history if operation succeeded and we can undo it
|
3236
3247
|
add_undo_operation(undo_info)
|
3237
3248
|
else
|
@@ -4295,7 +4306,10 @@ def get_cached_file_metadata(file_path) # {{{2
|
|
4295
4306
|
metadata = nil
|
4296
4307
|
begin
|
4297
4308
|
if file_path.match(@imagefile) && cmd?('identify')
|
4298
|
-
|
4309
|
+
# Skip SVG files as identify can be very slow on them
|
4310
|
+
unless file_path =~ /\.svg$/i
|
4311
|
+
metadata = `identify -format " [%wx%h %m %[colorspace] %[bit-depth]-bit]" #{Shellwords.escape(file_path)} 2>/dev/null`.strip
|
4312
|
+
end
|
4299
4313
|
elsif file_path.match(@pdffile)
|
4300
4314
|
info = `pdfinfo #{Shellwords.escape(file_path)} 2>/dev/null`
|
4301
4315
|
pages = info[/^Pages:\s+(\d+)/, 1]
|
@@ -4647,9 +4661,12 @@ def render # RENDER ALL PANES {{{2
|
|
4647
4661
|
if cached_meta
|
4648
4662
|
text += cached_meta
|
4649
4663
|
elsif @selected&.match(@imagefile) && cmd?('identify')
|
4650
|
-
#
|
4651
|
-
|
4652
|
-
|
4664
|
+
# Skip SVG files as identify can be very slow on them
|
4665
|
+
unless @selected =~ /\.svg$/i
|
4666
|
+
# Fallback for non-cached image metadata
|
4667
|
+
meta = `identify -format " [%wx%h %m %[colorspace] %[bit-depth]-bit]" #{Shellwords.escape(@selected)} 2>/dev/null`
|
4668
|
+
text += meta
|
4669
|
+
end
|
4653
4670
|
elsif @selected&.match(@pdffile)
|
4654
4671
|
# Fallback for non-cached PDF metadata
|
4655
4672
|
info = `pdfinfo #{Shellwords.escape(@selected)} 2>/dev/null`
|
@@ -5200,6 +5217,9 @@ def showcommand(cmd) # Helper function for showcontent {{{2
|
|
5200
5217
|
end
|
5201
5218
|
|
5202
5219
|
def showcontent # SHOW CONTENTS IN THE RIGHT WINDOW {{{2
|
5220
|
+
# Only process content if preview is enabled
|
5221
|
+
return unless @preview
|
5222
|
+
|
5203
5223
|
if @pR.update
|
5204
5224
|
showimage('clear') if @image
|
5205
5225
|
@image = false
|
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.0.
|
4
|
+
version: 7.0.8
|
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-08-
|
11
|
+
date: 2025-08-21 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 v7.0.
|
56
|
+
RTFM v7.0.8: Fixed SVG processing hangs, improved undo system with unique trash filenames, and better preview handling.
|
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:
|