rtfm-filemanager 3.17 → 3.20

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 +40 -8
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ad84a78780b960bd4b85e38d8139daba9b9ac049e00980c760c789052837b947
4
- data.tar.gz: 33cf4921acdd4082470647fd347f8d7cb8f4d3a15adc321c393c9ba7dc58c065
3
+ metadata.gz: 8f22769d80371a16fd03a6810a49d37cc0fab97250be947e983ce4f617dccf8f
4
+ data.tar.gz: 3a08da56b08a2e34b5f9b0fb6d629b0808b2e8c5ec8175ba770a609a452bec4e
5
5
  SHA512:
6
- metadata.gz: 99f4824e6b886f711ba3d26fa2bf7b2e6701d5b0634dd38f35d81ee78b983629ba54ac64793eba16d77a7fba2f9b288c039b9439301e77b62562e2f11df3abe6
7
- data.tar.gz: 8252e376be2e90e11286f8e283c30322164cef7cbb1b29eb72b56f01db28da9102a62c632a199989349dfd4cd51bb2c556fb71f8085b8edf702846ad47f69f30
6
+ metadata.gz: 555070d815f6dd2c62f1c41e18dadb5a624bdf82dfa124d03cf51b2c275302c92c14ebe4931ddf101b2d5b4cd21cb5a28f68e08cabf97c57634e9dcb10ac8473
7
+ data.tar.gz: 33256ae65fc9b2437dda6fc503c490976ebc3d6744aea3c1cdf4977c2067e9d8d8d3c4228572eb958357f5463d0a18d283068f58c9f6d5264e4fedfa4d7feb92
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.17"
17
+ @version = "3.20"
18
18
 
19
19
  # PRELIMINARIES
20
20
  @help = <<HELPTEXT
@@ -143,9 +143,38 @@ def firstrun
143
143
 
144
144
  FIRSTRUN
145
145
 
146
- if not File.exist?(Dir.home+'/.rtfm.launch')
147
- @rtfmlaunch = <<RTFMLAUNCH
148
- # This is the RTFM launcher (https://github.com/isene/RTFM)
146
+ @shell = File.basename(`echo "$SHELL"`.chomp)
147
+ if @shell == "fish"
148
+ if not File.exist?(Dir.home+'/.config/fish/config.fish')
149
+ @rtfmlaunch = <<RTFMFISHLAUNCH
150
+ # This is the RTFM launcher (https://github.com/isene/RTFM) for fish
151
+ function r {
152
+ f=$(mktemp)
153
+ (
154
+ set +e
155
+ rtfm "$f"
156
+ code=$?
157
+ if [ "$code" != 0 ]; then
158
+ rm -f "$f"
159
+ exit "$code"
160
+ fi
161
+ )
162
+ code=$?
163
+ if [ "$code" != 0 ]; then
164
+ return "$code"
165
+ fi
166
+ d=$(<"$f")
167
+ rm -f "$f"
168
+ cd "$d"
169
+ }
170
+ RTFMFISHLAUNCH
171
+ File.write(Dir.home+'/.config/fish/config.fish', @rtfmlaunch)
172
+ `echo "source ~/.config/fish/config.fish" >> .#{@shell}rc`
173
+ end
174
+ else
175
+ if not File.exist?(Dir.home+'/.rtfm.launch')
176
+ @rtfmlaunch = <<RTFMLAUNCH
177
+ # This is the RTFM launcher (https://github.com/isene/RTFM) for bash/zsh
149
178
  function r {
150
179
  f=$(mktemp)
151
180
  (
@@ -166,9 +195,9 @@ function r {
166
195
  cd "$d"
167
196
  }
168
197
  RTFMLAUNCH
169
- File.write(Dir.home+'/.rtfm.launch', @rtfmlaunch)
170
- @shell = File.basename(`echo "$SHELL"`.chomp)
171
- `echo "source ~/.rtfm.launch" >> .#{@shell}rc`
198
+ File.write(Dir.home+'/.rtfm.launch', @rtfmlaunch)
199
+ `echo "source ~/.rtfm.launch" >> .#{@shell}rc`
200
+ end
172
201
  end
173
202
 
174
203
  puts @firstrun
@@ -335,6 +364,7 @@ def getchr # PROCESS KEY PRESSES
335
364
  when '6' then chr = "PgDOWN" ; chr = "C-PgDOWN" if STDIN.getc == "^"
336
365
  when '7' then chr = "HOME" ; chr = "C-HOME" if STDIN.getc == "^"
337
366
  when '8' then chr = "END" ; chr = "C-END" if STDIN.getc == "^"
367
+ else chr = ""
338
368
  end
339
369
  when 'O' # Set Ctrl+ArrowKey equal to ArrowKey; May be used for other purposes in the future
340
370
  case STDIN.getc
@@ -342,6 +372,7 @@ def getchr # PROCESS KEY PRESSES
342
372
  when 'b' then chr = "C-DOWN"
343
373
  when 'c' then chr = "C-RIGHT"
344
374
  when 'd' then chr = "C-LEFT"
375
+ else chr = ""
345
376
  end
346
377
  end
347
378
  when "", "" then chr = "BACK"
@@ -359,6 +390,7 @@ def getchr # PROCESS KEY PRESSES
359
390
  when "\r" then chr = "ENTER"
360
391
  when "\t" then chr = "TAB"
361
392
  when /[[:print:]]/ then chr = c
393
+ else chr = ""
362
394
  end
363
395
  return chr
364
396
  end
@@ -905,7 +937,7 @@ def main_getkey # GET KEY FROM USER
905
937
  @w_r.update = true if dir != Dir.pwd
906
938
  rescue
907
939
  end
908
- $STDIN = ""
940
+ #$STDIN = ""
909
941
  end
910
942
  def conf_write
911
943
  if File.exist?(Dir.home+'/.rtfm.conf')
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.17'
4
+ version: '3.20'
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-09-12 00:00:00.000000000 Z
11
+ date: 2024-10-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: curses
@@ -48,7 +48,7 @@ description: 'A full featured terminal browser with syntax highlighted files, im
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
50
  other features. New in 3.14: Better error handling. 3.14.1: Fixed bug in launching
51
- rtfm without the launcher ''r''. 3.17: Fixed an insideous bug by flushing STDIN.'
51
+ rtfm without the launcher ''r''. 3.20: Added launcher for the fish shell.'
52
52
  email: g@isene.com
53
53
  executables:
54
54
  - rtfm