rtfm-filemanager 3.20 → 3.25

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/bin/rtfm +27 -23
  3. metadata +3 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8f22769d80371a16fd03a6810a49d37cc0fab97250be947e983ce4f617dccf8f
4
- data.tar.gz: 3a08da56b08a2e34b5f9b0fb6d629b0808b2e8c5ec8175ba770a609a452bec4e
3
+ metadata.gz: 354d37b0c84cd1a4bc9f1c6923076ab0d8acdebccca9933aac966edd918125ca
4
+ data.tar.gz: 0d393395786e90b8b18053fade19043c2525a8736a546ed0e9fa9f44c98c0238
5
5
  SHA512:
6
- metadata.gz: 555070d815f6dd2c62f1c41e18dadb5a624bdf82dfa124d03cf51b2c275302c92c14ebe4931ddf101b2d5b4cd21cb5a28f68e08cabf97c57634e9dcb10ac8473
7
- data.tar.gz: 33256ae65fc9b2437dda6fc503c490976ebc3d6744aea3c1cdf4977c2067e9d8d8d3c4228572eb958357f5463d0a18d283068f58c9f6d5264e4fedfa4d7feb92
6
+ metadata.gz: fdb5804d4f2a6271168652e80f8c9c71697aa7e42aff709c5aeb37868595b69b5cdc8fb8029b00e3f4bb80ad4c53853023ca69a0fa77e89924522a8e076e06ee
7
+ data.tar.gz: 96c982c709424a6eb32a3d63208a2360d209fefb1771241cbb359156482d22b314f799f59818f4879def92f093a88759badcd187607c1ce85728d0b508a6e2c1
data/bin/rtfm CHANGED
@@ -14,7 +14,7 @@
14
14
  # for any damages resulting from its use. Further, I am under no
15
15
  # obligation to maintain or extend this software. It is provided
16
16
  # on an 'as is' basis without any expressed or implied warranty.
17
- @version = "3.20"
17
+ @version = "3.25"
18
18
 
19
19
  # PRELIMINARIES
20
20
  @help = <<HELPTEXT
@@ -202,7 +202,7 @@ RTFMLAUNCH
202
202
 
203
203
  puts @firstrun
204
204
  puts "\n... hit ENTER to start RTFM. Hit ? inside RTFM to show the help text. Enjoy :-)"
205
- STDIN.gets
205
+ $stdin.gets
206
206
  end
207
207
  begin # BASIC SETUP
208
208
  require 'fileutils'
@@ -229,7 +229,7 @@ begin # BASIC SETUP
229
229
 
230
230
  cmd?('bat') ? @bat = "bat" : @bat = "batcat"
231
231
 
232
- STDIN.set_encoding(Encoding::UTF_8) # Set encoding for STDIN
232
+ $stdin.set_encoding(Encoding::UTF_8) # Set encoding for $stdin
233
233
 
234
234
  ## Curses setup
235
235
  Curses.init_screen
@@ -347,27 +347,28 @@ def getchr # PROCESS KEY PRESSES
347
347
  # Note: Curses.getch blanks out @w_t
348
348
  # @w_l.getch makes Curses::KEY_DOWN etc not work
349
349
  # Therefore resorting to the generic method
350
- c = STDIN.getch(min: 0, time: 3)
350
+ c = $stdin.getch(min: 0, time: 3)
351
351
  case c
352
352
  when "\e" # ANSI escape sequences
353
- case STDIN.getc
353
+ return "ESC" if $stdin.ready? == nil
354
+ case $stdin.getc
354
355
  when '[' # CSI
355
- case STDIN.getc
356
+ case $stdin.getc
356
357
  when 'A' then chr = "UP"
357
358
  when 'B' then chr = "DOWN"
358
359
  when 'C' then chr = "RIGHT"
359
360
  when 'D' then chr = "LEFT"
360
361
  when 'Z' then chr = "S-TAB"
361
- when '2' then chr = "INS" ; chr = "C-INS" if STDIN.getc == "^"
362
- when '3' then chr = "DEL" ; chr = "C-DEL" if STDIN.getc == "^"
363
- when '5' then chr = "PgUP" ; chr = "C-PgUP" if STDIN.getc == "^"
364
- when '6' then chr = "PgDOWN" ; chr = "C-PgDOWN" if STDIN.getc == "^"
365
- when '7' then chr = "HOME" ; chr = "C-HOME" if STDIN.getc == "^"
366
- when '8' then chr = "END" ; chr = "C-END" if STDIN.getc == "^"
362
+ when '2' then chr = "INS" ; chr = "C-INS" if $stdin.getc == "^"
363
+ when '3' then chr = "DEL" ; chr = "C-DEL" if $stdin.getc == "^"
364
+ when '5' then chr = "PgUP" ; chr = "C-PgUP" if $stdin.getc == "^"
365
+ when '6' then chr = "PgDOWN" ; chr = "C-PgDOWN" if $stdin.getc == "^"
366
+ when '7' then chr = "HOME" ; chr = "C-HOME" if $stdin.getc == "^"
367
+ when '8' then chr = "END" ; chr = "C-END" if $stdin.getc == "^"
367
368
  else chr = ""
368
369
  end
369
370
  when 'O' # Set Ctrl+ArrowKey equal to ArrowKey; May be used for other purposes in the future
370
- case STDIN.getc
371
+ case $stdin.getc
371
372
  when 'a' then chr = "C-UP"
372
373
  when 'b' then chr = "C-DOWN"
373
374
  when 'c' then chr = "C-RIGHT"
@@ -376,17 +377,19 @@ def getchr # PROCESS KEY PRESSES
376
377
  end
377
378
  end
378
379
  when "", "" then chr = "BACK"
379
- when "" then chr = "WBACK"
380
- when "" then chr = "LDEL"
381
380
  when "" then chr = "C-C"
382
381
  when "" then chr = "C-D"
382
+ when "" then chr = "C-E"
383
383
  when "" then chr = "C-G"
384
+ when " " then chr = "C-K"
384
385
  when " " then chr = "C-L"
385
386
  when "" then chr = "C-N"
386
387
  when "" then chr = "C-O"
387
388
  when "" then chr = "C-P"
388
389
  when "" then chr = "C-T"
389
390
  when "" then chr = "C-Y"
391
+ when "" then chr = "WBACK"
392
+ when "" then chr = "LDEL"
390
393
  when "\r" then chr = "ENTER"
391
394
  when "\t" then chr = "TAB"
392
395
  when /[[:print:]]/ then chr = c
@@ -484,11 +487,11 @@ def main_getkey # GET KEY FROM USER
484
487
  # JUMPING AND MARKS
485
488
  when 'm' # Set mark
486
489
  marks_info
487
- m = STDIN.getc
490
+ m = $stdin.getc
488
491
  if m.match(/[\w']/)
489
492
  @marks[m] = Dir.pwd
490
493
  elsif m == "-"
491
- r = STDIN.getc
494
+ r = $stdin.getc
492
495
  @marks.delete(r)
493
496
  end
494
497
  marks_info
@@ -643,7 +646,7 @@ def main_getkey # GET KEY FROM USER
643
646
  @tagged.push("\"#{Dir.pwd}/#{@selected}\"")
644
647
  @tagged.uniq!
645
648
  deletes = @tagged.join(" ")
646
- if STDIN.getc == 'y'
649
+ if $stdin.getc == 'y'
647
650
  `rm -rf #{deletes} 2>/dev/null`
648
651
  items_number = @tagged.length
649
652
  @tagged = []
@@ -937,7 +940,6 @@ def main_getkey # GET KEY FROM USER
937
940
  @w_r.update = true if dir != Dir.pwd
938
941
  rescue
939
942
  end
940
- #$STDIN = ""
941
943
  end
942
944
  def conf_write
943
945
  if File.exist?(Dir.home+'/.rtfm.conf')
@@ -1141,9 +1143,11 @@ def open_selected(html = nil) # OPEN SELECTED ITEM (when pressing RIGHT)
1141
1143
  system("exec $EDITOR #{@selected_safe}")
1142
1144
  else
1143
1145
  if @runmailcap
1144
- Thread.new { system("run-mailcap #{@selected_safe} 2>/dev/null") }
1146
+ #Thread.new { system("run-mailcap #{@selected_safe} 2>/dev/null") }
1147
+ system("run-mailcap #{@selected_safe} 2>/dev/null")
1145
1148
  else
1146
- Thread.new { system("xdg-open #{@selected_safe} 2>/dev/null") }
1149
+ #Thread.new { system("xdg-open #{@selected_safe} 2>/dev/null") }
1150
+ system("xdg-open #{@selected_safe} 2>/dev/null")
1147
1151
  end
1148
1152
  end
1149
1153
  @break = true
@@ -1590,8 +1594,8 @@ def w_b_getstr(pretext, text, ruby=false) # A SIMPLE READLINE-LIKE ROUTINE
1590
1594
  @history_copy[stk].insert(pos,chr)
1591
1595
  pos += 1
1592
1596
  end
1593
- while STDIN.ready?
1594
- chr = STDIN.getc
1597
+ while $stdin.ready?
1598
+ chr = $stdin.getc
1595
1599
  @history_copy[stk].insert(pos,chr)
1596
1600
  pos += 1
1597
1601
  end
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: '3.20'
4
+ version: '3.25'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geir Isene
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-10-04 00:00:00.000000000 Z
11
+ date: 2024-10-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: curses
@@ -47,8 +47,7 @@ dependencies:
47
47
  description: 'A full featured terminal browser with syntax highlighted files, images
48
48
  shown in the terminal, videos thumbnailed, etc. You can bookmark and jump around
49
49
  easily, delete, rename, copy, symlink and move files. RTFM has a a wide range of
50
- other features. New in 3.14: Better error handling. 3.14.1: Fixed bug in launching
51
- rtfm without the launcher ''r''. 3.20: Added launcher for the fish shell.'
50
+ other features. New in 3.25: Fixed the strange ESC bug'
52
51
  email: g@isene.com
53
52
  executables:
54
53
  - rtfm