fzf
fzf copied to clipboard
--tiebreak ignores -n
- Category
- [x] fzf binary
- [ ] fzf-tmux script
- [ ] Key bindings
- [ ] Completion
- [ ] Vim
- [ ] Neovim
- [ ] Etc.
- OS
- [x] Linux
- [ ] Mac OS X
- [ ] Windows
- [ ] Windows Subsystem for Linux
- [ ] Etc.
- Shell
- [x] bash
- [ ] zsh
- [ ] fish
Thank you for fzf
. It is one of those tools you can no longer live without, once it has infected your brain.
printf '%s\n' 'a looooooooong' 'aaa short' | fzf -n1
Type a
after invoking fzf
as above. The aaa short
item is selected, even though -n
has supposedly limited search scope to the first field (a
vs aaa
).
It seems that tie-breaking settings ignore -n
. Is this a bug? #926 looks to be related.
■ fzf --version
0.18.0 (6577388)
For query a
, its a tie for both lines. The default tiebreak is based on length criterion.
What you do:
printf '%s\n' 'a looooooooong' 'aaa short' | fzf -n1 --tiebreak=length
what you want:
printf '%s\n' 'a looooooooong' 'aaa short' | fzf -n1 --tiebreak=index