Add field-based tracking across reloads (--track=NTH)

Allow --track to accept an optional nth expression for cross-reload
tracking. When a reload is triggered, fzf extracts a tracking key from
the current item using the nth expression, blocks the UI, and searches
for a matching item in the reloaded list.

- --track=.. tracks by entire line, --track=1 by first field, etc.
- --track without NTH retains existing index-based behavior
- UI is blocked during search (dimmed query, hidden cursor, +T*/+t*)
- reload unblocks eagerly on match; reload-sync waits for stream end
- Escape/Ctrl-C cancels blocked state without quitting
- track-current action accepts optional nth: track-current(1)
- Validate nth expression at parse time for both --track and track()
- Cache trackKeyFor results per item to avoid redundant computation
- Rename executeRegexp to argActionRegexp

Close #4701
Close #3460
This commit is contained in:
Junegunn Choi committed 2026-03-14 20:52:04 +09:00
1 parent 7a811f0cb8
commit 9f422851fe
5 files changed
+370 -17

No files matched your search

+11 -1
View File
@@ -1,8 +1,18 @@
CHANGELOG
=========
0.70.1
0.71.0
------
- Cross-reload tracking
- `--track` now accepts an optional nth expression (`--track=NTH`) for field-based tracking across `reload`s
- `--track` without `NTH` retains the existing index-based tracking behavior (does not persist across reloads)
- `--track=..` tracks by the entire line across reloads
- `--track=1` tracks by the first field across reloads
- When a `reload` is triggered, fzf searches for the tracked item by its nth field in the new list.
- The UI is temporarily blocked (prompt dimmed, input disabled) until the item is found or loading completes.
- Press `Escape` or `Ctrl-C` to cancel the blocked state without quitting
- Info line shows `+T*` / `+t*` while searching
- `track-current` action now also accepts an optional nth argument: `track-current(1)`
- Performance improvements
- The search performance now scales linearly with the number of CPU cores, as we dropped static partitioning to allow better load balancing across threads.
```