rufio 0.90.1 → 0.91.0
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/CHANGELOG.md +24 -0
- data/lib/rufio/config.rb +2 -2
- data/lib/rufio/shell_command_completion.rb +7 -6
- data/lib/rufio/terminal_ui.rb +43 -32
- data/lib/rufio/ui_renderer.rb +12 -1
- data/lib/rufio/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0c50fc72fd43046f6fb861b05ff378c5122ebfa1bba180463340a5f1e906ad3f
|
|
4
|
+
data.tar.gz: 7e5fcc725fafc5ceeeb90433a5cb767e3d0c98431a0b5bdb554f727a99fb50f5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5eb8c2b7955f69c822d58aaf976be1669aa446d12eacbac4fe24c0e152ffd6d79631488e6c0debdb7e232b477321ee4d5617873e06be5da1999704b28fe4554f
|
|
7
|
+
data.tar.gz: fd71f1119f3ae724ecd8c220c6c9401a7dfd4d4fa40108aa2d5320afd23a2c181589224cbd157a28f8cbbcad847f48285bc4108cd583cec93230e74466cdafd0
|
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,30 @@ All notable changes to rufio will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.91.0] - 2026-04-12
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
- **Limit status bar path display to 2 parent directories above current**: Fixes overly long path display when navigating deep directory trees
|
|
12
|
+
- e.g. `/home/user/projects/ruby/myapp` → `…/ruby/myapp`
|
|
13
|
+
- Paths with 3 or fewer segments are shown in full
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
- **Windows CI: 36 test failures resolved**
|
|
17
|
+
- `test_file_opener.rb`: Replaced hardcoded `/tmp/` paths with `Dir.mktmpdir`
|
|
18
|
+
- Added "Install:" prefix to `health.install_guide` message
|
|
19
|
+
- Added `skip` guards for Windows-incompatible tests (`.sh` execution, Unix paths, `chmod`, snapshots, etc.)
|
|
20
|
+
- **Windows CI: `pastel` gem not found when running `test_windows_console_input.rb`**: Changed run command from `ruby` to `bundle exec ruby`
|
|
21
|
+
|
|
22
|
+
## [0.90.2] - 2026-04-11
|
|
23
|
+
|
|
24
|
+
### Added
|
|
25
|
+
- **Windows mouse support (Windows Terminal)**: Mouse click and scroll now work on Windows Terminal using button-events mode (`\e[?1000h\e[?1006h`) instead of any-event mode (`\e[?1003h`) which is unsupported on Windows
|
|
26
|
+
- Left click, double-click, and wheel scroll are supported (same as Unix)
|
|
27
|
+
- `read_next_mouse_byte` introduced with a 20ms timeout to handle Windows Console's per-byte event queuing for long SGR sequences
|
|
28
|
+
- `cleanup_terminal` sends the matching `\e[?1000l\e[?1006l` on Windows
|
|
29
|
+
- **CI: Windows GitHub Actions**: Added `test-windows` job (`windows-latest`, Ruby 3.2/3.3) running the full test suite plus `test_windows_console_input.rb`
|
|
30
|
+
- Covers ESC key, multibyte input, mouse SGR sequence parsing, and `IO.select` timeout behavior
|
|
31
|
+
|
|
8
32
|
## [0.90.1] - 2026-03-28
|
|
9
33
|
|
|
10
34
|
### Fixed
|
data/lib/rufio/config.rb
CHANGED
|
@@ -86,7 +86,7 @@ module Rufio
|
|
|
86
86
|
'health.windows_opener' => 'Windows file opener',
|
|
87
87
|
'health.install_brew' => 'Install: brew install',
|
|
88
88
|
'health.install_apt' => 'Install: apt install',
|
|
89
|
-
'health.install_guide' => 'Check installation guide for your platform',
|
|
89
|
+
'health.install_guide' => 'Install: Check the installation guide for your platform',
|
|
90
90
|
'health.rga_releases' => 'Install: https://github.com/phiresky/ripgrep-all/releases',
|
|
91
91
|
'health.ruby_upgrade_needed' => 'Please upgrade Ruby to version 2.7.0 or higher'
|
|
92
92
|
},
|
|
@@ -156,7 +156,7 @@ module Rufio
|
|
|
156
156
|
'health.windows_opener' => 'Windows file opener',
|
|
157
157
|
'health.install_brew' => 'Install: brew install',
|
|
158
158
|
'health.install_apt' => 'Install: apt install',
|
|
159
|
-
'health.install_guide' => 'Check installation guide for your platform',
|
|
159
|
+
'health.install_guide' => 'Install: Check the installation guide for your platform',
|
|
160
160
|
'health.rga_releases' => 'Install: https://github.com/phiresky/ripgrep-all/releases',
|
|
161
161
|
'health.ruby_upgrade_needed' => 'Please upgrade Ruby to version 2.7.0 or higher'
|
|
162
162
|
}
|
|
@@ -88,12 +88,13 @@ module Rufio
|
|
|
88
88
|
paths.each do |path|
|
|
89
89
|
next unless Dir.exist?(path)
|
|
90
90
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
91
|
+
begin
|
|
92
|
+
Dir.glob(File.join(path, '*')) do |filepath|
|
|
93
|
+
file = File.basename(filepath)
|
|
94
|
+
commands << file if File.executable?(filepath) && !File.directory?(filepath)
|
|
95
|
+
end
|
|
96
|
+
rescue StandardError
|
|
97
|
+
next
|
|
97
98
|
end
|
|
98
99
|
end
|
|
99
100
|
|
data/lib/rufio/terminal_ui.rb
CHANGED
|
@@ -186,8 +186,16 @@ module Rufio
|
|
|
186
186
|
STDIN.raw!
|
|
187
187
|
end
|
|
188
188
|
|
|
189
|
-
# SGR
|
|
190
|
-
|
|
189
|
+
# SGR拡張マウスレポートを有効化
|
|
190
|
+
# Unix: \e[?1003h (any-event) + \e[?1006h (SGR座標) → クリック・スクロール・移動
|
|
191
|
+
# Windows: \e[?1003h は Windows Terminal / conhost 非対応。
|
|
192
|
+
# \e[?1000h (button-events のみ) + \e[?1006h (SGR座標) で
|
|
193
|
+
# Windows Terminal 限定でクリック・スクロールに対応。
|
|
194
|
+
if windows?
|
|
195
|
+
print "\e[?1000h\e[?1006h"
|
|
196
|
+
else
|
|
197
|
+
print "\e[?1003h\e[?1006h"
|
|
198
|
+
end
|
|
191
199
|
STDOUT.flush
|
|
192
200
|
|
|
193
201
|
# re-acquire terminal size (just in case)
|
|
@@ -206,32 +214,27 @@ module Rufio
|
|
|
206
214
|
RUBY_PLATFORM =~ /mswin|mingw/ ? true : false
|
|
207
215
|
end
|
|
208
216
|
|
|
209
|
-
#
|
|
210
|
-
# IO.select
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
)
|
|
219
|
-
@win32_get_num_events ||= Fiddle::Function.new(
|
|
220
|
-
@win32_kernel32['GetNumberOfConsoleInputEvents'],
|
|
221
|
-
[Fiddle::TYPE_VOIDP, Fiddle::TYPE_VOIDP], Fiddle::TYPE_INT
|
|
222
|
-
)
|
|
223
|
-
handle = @win32_get_std_handle.call(-10) # STD_INPUT_HANDLE = (DWORD)(-10)
|
|
224
|
-
count_ptr = Fiddle::Pointer.malloc(4)
|
|
225
|
-
@win32_get_num_events.call(handle, count_ptr)
|
|
226
|
-
count_ptr[0, 4].unpack1('L') > 0
|
|
227
|
-
rescue Fiddle::DLError
|
|
228
|
-
# fiddle が使えない場合は常に入力ありとみなし read_nonblock に任せる
|
|
229
|
-
true
|
|
217
|
+
# エスケープシーケンスの後続バイトを読み取る(矢印キー等の短いシーケンス用)。
|
|
218
|
+
# Windows: IO.select(timeout=0) がESCを取りこぼすため 5ms タイムアウトを使用。
|
|
219
|
+
def read_next_input_byte
|
|
220
|
+
if windows?
|
|
221
|
+
return nil unless IO.select([STDIN], nil, nil, 0.005)
|
|
222
|
+
STDIN.read_nonblock(1) rescue nil
|
|
223
|
+
else
|
|
224
|
+
STDIN.read_nonblock(1) rescue nil
|
|
225
|
+
end
|
|
230
226
|
end
|
|
231
227
|
|
|
232
|
-
#
|
|
233
|
-
|
|
234
|
-
|
|
228
|
+
# SGRマウスシーケンスの後続バイトを読み取る。
|
|
229
|
+
# \e[<Btn;Col;RowM/m は最大 15 バイト程度になるため、
|
|
230
|
+
# Windows Console のイベントキューにバイトが積まれるまで 20ms 待つ。
|
|
231
|
+
def read_next_mouse_byte
|
|
232
|
+
if windows?
|
|
233
|
+
return nil unless IO.select([STDIN], nil, nil, 0.020)
|
|
234
|
+
STDIN.read_nonblock(1) rescue nil
|
|
235
|
+
else
|
|
236
|
+
STDIN.read_nonblock(1) rescue nil
|
|
237
|
+
end
|
|
235
238
|
end
|
|
236
239
|
|
|
237
240
|
def cleanup_terminal
|
|
@@ -240,8 +243,12 @@ module Rufio
|
|
|
240
243
|
STDIN.cooked!
|
|
241
244
|
end
|
|
242
245
|
|
|
243
|
-
#
|
|
244
|
-
|
|
246
|
+
# マウスレポートを無効化(setup_terminal と対称)
|
|
247
|
+
if windows?
|
|
248
|
+
print "\e[?1000l\e[?1006l"
|
|
249
|
+
else
|
|
250
|
+
print "\e[?1003l\e[?1006l"
|
|
251
|
+
end
|
|
245
252
|
STDOUT.flush
|
|
246
253
|
|
|
247
254
|
system('tput rmcup') # normal screen
|
|
@@ -425,13 +432,15 @@ module Rufio
|
|
|
425
432
|
private
|
|
426
433
|
|
|
427
434
|
# ノンブロッキング入力処理(ゲームループ用)
|
|
428
|
-
# Windows:
|
|
435
|
+
# Windows: IO.select(timeout=1ms) で入力確認後 read_nonblock
|
|
436
|
+
# timeout=0 だとESCキーを取りこぼす(コンソールの処理タイミング競合)ため
|
|
437
|
+
# 1ms の正のタイムアウトを使う。コンソールハンドルでも ConPTY パイプでも動作する。
|
|
429
438
|
# Unix: IO.select(timeout=0) で入力確認後 read_nonblock
|
|
430
439
|
def handle_input_nonblocking
|
|
431
440
|
# 入力バイトを1つ読み取る
|
|
432
441
|
if windows?
|
|
433
|
-
# Windows:
|
|
434
|
-
return false unless
|
|
442
|
+
# Windows: timeout=0 ではESCキーを取りこぼすため 1ms タイムアウトを使用
|
|
443
|
+
return false unless IO.select([STDIN], nil, nil, 0.001)
|
|
435
444
|
else
|
|
436
445
|
# Unix: 0msタイムアウトで即座にチェック(30FPS = 33.33ms/frame)
|
|
437
446
|
return false unless IO.select([STDIN], nil, nil, 0)
|
|
@@ -459,9 +468,11 @@ module Rufio
|
|
|
459
468
|
third_char = read_next_input_byte
|
|
460
469
|
if third_char == '<'
|
|
461
470
|
# SGR拡張マウスイベント: \e[<Btn;Col;RowM/m
|
|
471
|
+
# Windows では各バイトが個別のコンソールイベントとして届くため
|
|
472
|
+
# read_next_mouse_byte(20ms タイムアウト)で読み取る
|
|
462
473
|
mouse_seq = +""
|
|
463
474
|
loop do
|
|
464
|
-
ch =
|
|
475
|
+
ch = read_next_mouse_byte
|
|
465
476
|
break if ch.nil?
|
|
466
477
|
mouse_seq << ch
|
|
467
478
|
break if ch == 'M' || ch == 'm'
|
data/lib/rufio/ui_renderer.rb
CHANGED
|
@@ -621,7 +621,7 @@ module Rufio
|
|
|
621
621
|
current_x += 1
|
|
622
622
|
|
|
623
623
|
path_end = @screen_width - 1 - version_w
|
|
624
|
-
path_str = " #{current_path} "
|
|
624
|
+
path_str = " #{shorten_path(current_path)} "
|
|
625
625
|
path_str.each_char do |char|
|
|
626
626
|
break if current_x >= path_end
|
|
627
627
|
char_w = TextUtils.display_width(char)
|
|
@@ -761,5 +761,16 @@ module Rufio
|
|
|
761
761
|
|
|
762
762
|
@tab_mode_manager.switch_to(current_mode) if @tab_mode_manager.current_mode != current_mode
|
|
763
763
|
end
|
|
764
|
+
|
|
765
|
+
# パスを最大2階層上まで表示する短縮形式に変換する
|
|
766
|
+
# 例: /a/b/c/d/e → …/c/d/e
|
|
767
|
+
def shorten_path(path, max_parents = 2)
|
|
768
|
+
sep = '/'
|
|
769
|
+
parts = path.gsub('\\', sep).split(sep).reject(&:empty?)
|
|
770
|
+
# current + 2 parents = 3 segments まではフルパスを表示
|
|
771
|
+
return path if parts.length <= max_parents + 1
|
|
772
|
+
|
|
773
|
+
"…/#{parts.last(max_parents + 1).join(sep)}"
|
|
774
|
+
end
|
|
764
775
|
end
|
|
765
776
|
end
|
data/lib/rufio/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rufio
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.91.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- masisz
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-04-12 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: io-console
|