rtfm-filemanager 3.21 → 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 +23 -21
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 96b0499ea2e30e6a11cb9812c40d4d7d7f976f8d6a6dbdafa5cb1f94050605be
4
- data.tar.gz: 35d2855b64c68e023bd43e0ece6660a152d4cba9f65a36d7a5d0c760a44a5f24
3
+ metadata.gz: 354d37b0c84cd1a4bc9f1c6923076ab0d8acdebccca9933aac966edd918125ca
4
+ data.tar.gz: 0d393395786e90b8b18053fade19043c2525a8736a546ed0e9fa9f44c98c0238
5
5
  SHA512:
6
- metadata.gz: cc749fd74294f80e47c830a910ae34a9185e6aebb4edbecf22c5f17d3deddc6a49c061e85e1173b9915fd25a84c49f34606f037a01143d50e1387c3de7d9a210
7
- data.tar.gz: 34fba10ce85407bdf230c14ce6d7d0cd23dc7f3e1a38f4889d024dae5c540983b6329f519373efd5fb41a6c42caa75a01cf7a21b75fb8b2ec7b838028ba7e8e0
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.21"
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')
@@ -1592,8 +1594,8 @@ def w_b_getstr(pretext, text, ruby=false) # A SIMPLE READLINE-LIKE ROUTINE
1592
1594
  @history_copy[stk].insert(pos,chr)
1593
1595
  pos += 1
1594
1596
  end
1595
- while STDIN.ready?
1596
- chr = STDIN.getc
1597
+ while $stdin.ready?
1598
+ chr = $stdin.getc
1597
1599
  @history_copy[stk].insert(pos,chr)
1598
1600
  pos += 1
1599
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.21'
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-07 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,7 +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.21: Fixed bug related to ''x'''
50
+ other features. New in 3.25: Fixed the strange ESC bug'
51
51
  email: g@isene.com
52
52
  executables:
53
53
  - rtfm