rtfm-filemanager 7.1.1 → 7.1.3

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 -7
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3a39d2642135dedd764081bbacf9324552b2e398570d128da2447d8586b30b1d
4
- data.tar.gz: e4619be8f3579ad2f2f26b1c2a84b14a8e3712a23f2a33c01225566124209f50
3
+ metadata.gz: fc43a3881cc5f944d08ca2f0aeaaf70f712b79b77e51cbccebf9df7a892282f3
4
+ data.tar.gz: f7b1897e5accadf7d638b72bcd50ce8b88691162a60261baf7added43fe1cc09
5
5
  SHA512:
6
- metadata.gz: c576e346669cffe05991d30829c165f24af56435cde8e29906e8fe1aa2faddb8d1fbe0183a063700e4e6532d9b4e2773ebbbe3fb7d6c2c5608f9f479654a8205
7
- data.tar.gz: 679467d5bdad962dc4a5e460336f6e3ae5f1b245e187b8d06f27eeeb101ca4980c2aef623be2d2c8078319d0c7fa83b7e6e97c24df19f7bda098658fd04cb6a2
6
+ metadata.gz: e0b54e7a21bae71705dd1a3d4978cd435c0d6119f876c8de23709feb68483343eeabdf39a287de5dcd48a8ec5758ee467028f661e9bae9a4925ac240a2cdf53b
7
+ data.tar.gz: bf57c7c14d8bdeb2ebc907b92fe373416c7f69b5691903115be61f90d89fdeeaf26a20445099251057b7c7e4f7e0714dec8583134cdabf9a38f1d86916942c7d
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.14' # Fixed regex error when using '*' to mark all files with C-T
21
+ @version = '7.1.3' # Fixed permission change color update and broken symlink deletion
22
22
 
23
23
  # SAVE & STORE TERMINAL {{{1
24
24
  ORIG_STTY = `stty -g`.chomp
@@ -3243,8 +3243,9 @@ def delete_items # {{{3
3243
3243
  prompt_text = @trash ? "Move to trash? (y/n)" : "⚠️ PERMANENTLY DELETE? (y/n)"
3244
3244
  @pB.say(" #{prompt_text}".fg(action_color))
3245
3245
  if getchr == 'y'
3246
- # collect & escape every path with existence verification
3247
- paths = (@tagged + [@selected]).uniq.select { |p| File.exist?(p) }
3246
+ # Collect paths - include broken symlinks since they can be moved/deleted
3247
+ # File.exist? returns false for broken symlinks, but File.symlink? still works
3248
+ paths = (@tagged + [@selected]).uniq.select { |p| File.exist?(p) || File.symlink?(p) }
3248
3249
  if paths.empty?
3249
3250
  @pB.say("No valid items to #{action.downcase}".fg(196))
3250
3251
  else
@@ -3341,7 +3342,7 @@ def change_ownership # {{{3
3341
3342
  end
3342
3343
 
3343
3344
  def change_permissions # {{{3
3344
- # strip leading “-” off e.g. "-rwxr-xr-x" → "rwxr-xr-x"
3345
+ # strip leading "-" off e.g. "-rwxr-xr-x" → "rwxr-xr-x"
3345
3346
  default = @fileattr.split[1][1..]
3346
3347
  ans = @pB.ask('Permissions: ', default)
3347
3348
  # Reset bottom pane after input
@@ -3378,6 +3379,9 @@ def change_permissions # {{{3
3378
3379
  File.chmod(mode, @selected)
3379
3380
  @tagged.each { |t| File.chmod(mode, t) rescue nil }
3380
3381
  @pB.say("Permissions changed to: #{mode.to_s(8)}")
3382
+ # Invalidate cache for current directory to show updated colors
3383
+ @dir_cache.delete_if { |key, _| key.start_with?("#{Dir.pwd}:") }
3384
+ @pL.update = true
3381
3385
  end
3382
3386
  end
3383
3387
  end
@@ -5369,7 +5373,7 @@ def showcontent # SHOW CONTENTS IN THE RIGHT WINDOW {{{2
5369
5373
  .gsub(/&#(\d+);/, '&#\1;')
5370
5374
  .gsub(/&#x([0-9a-fA-F]+);/, '&#x\1;')
5371
5375
  File.write(temp_svg, fixed_content)
5372
-
5376
+
5373
5377
  if system("convert #{Shellwords.escape(temp_svg)} #{Shellwords.escape(tn)} 2>/dev/null")
5374
5378
  showimage(tn)
5375
5379
  @image = true
@@ -5404,9 +5408,19 @@ def showcontent # SHOW CONTENTS IN THE RIGHT WINDOW {{{2
5404
5408
  showimage(tn)
5405
5409
  @image = true
5406
5410
  else
5407
- @pR.say("No preview available for #{@selected}")
5411
+ # Check if file is text using the `file` command
5412
+ file_type = `file --mime-type -b #{Shellwords.escape(@selected)} 2>/dev/null`.strip
5413
+ if file_type.start_with?('text/') || file_type == 'application/x-empty'
5414
+ # It's a text file - fall through to text preview below
5415
+ else
5416
+ @pR.say("No preview available for #{@selected}")
5417
+ return # Exit early to avoid text preview attempt
5418
+ end
5408
5419
  end
5409
- else # Fallback: treat as text if UTF‑8
5420
+ end
5421
+
5422
+ # Fallback: treat as text if no handler matched
5423
+ unless tmpl || pattern
5410
5424
  # Don't try to preview PDFs as text - they contain binary data
5411
5425
  if @selected&.match(@pdffile)
5412
5426
  @pR.say("No preview available for #{@selected}")
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.1.1
4
+ version: 7.1.3
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-09 00:00:00.000000000 Z
11
+ date: 2025-10-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.1.1: Fixed 'A' key toggle for long file info display - now properly shows ls -l format with user feedback and correct cache invalidation.
56
+ RTFM v7.1.3: Fixed permission change color update and broken symlink deletion.
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: