fzy
fzy copied to clipboard
Enable multi-select
This enables multi-select in fzy with the Ctrl+t key. Pressing Ctrl+t on an item will make that item bold. Pressing Ctrl+t will de-select it. When at least one item is multi-selected, pressing the Return key will print each multi-selected item on its own line to stdout (this mimics the behavior of fzf's multi-select feature).
EDIT: Updated the key binding to Ctrl+t.
Nice work! I only want to point out that Ctrl-s is an unfortunate shortcut, because pressing Ctrl-s makes my terminal hang (and requires pressing Ctrl-q to unblock it). While searching for what's going on I discovered that running stty -ixon disables the "hang" functionality and therefore allows fzy to intercept and react on pressing Ctrl-s, but given that many people would probably stumble upon this issue as well, maybe we can choose a more "friendly" default shortcut.
Ahhh, the tyranny of control flow. Admittedly, I forgot about this anti-feature as I haven't personally run into it in quite some time.
You're right of course that Ctrl-s will not work while control flow is
still enabled by default in most terminals/shells. Some other
alternative bindings I considered are Ctrl-t, Ctrl-f, and Ctrl-Space.
Of these I think I would prefer Ctrl-t because it has the mnemonic of
"tag". Any thoughts here?
On Tue, 15 Oct 2019 at 01:24:37 PM +0000, Maxim Baz wrote:
Nice work! I only want to point out that
Ctrl-sis an unfortunate shortcut, because pressingCtrl-smakes my terminal hang (and requires pressingCtrl-qto unblock it). While searching for what's going on I discovered that runningstty -ixondisables the "hang" functionality and therefore allowsfzyto intercept and react on pressingCtrl-s, but given that many people would probably stumble upon this issue as well, maybe we can choose a more "friendly" default shortcut.-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/jhawthorn/fzy/pull/124#issuecomment-542209768
I would probably vote for Ctrl+Space as it's easier to type, but Ctrl+t sounds OK too.
Have you considered moving the selection down when you press the "select" shortcut? So that when you run echo 'a\nb\nc\nd' | ./fzy pressing Ctrl+Space three times would select a, b and c?
Here's a small bug I discovered:
- Run
echo 'a\nb\nc\nd' | ./fzy - Type
aa<Ctrl-s><Backspace><Enter>
[1] 566797 done echo 'a\nb\nc\nd' |
566798 segmentation fault (core dumped) ./fzy
I'm not able to reproduce this - are you up-to-date on the multiselect
branch of my fork? I did make some updates after my initial commit, some
of which addressed a few memory-related bugs.
On Tue, 15 Oct 2019 at 07:14:58 AM -0700, Maxim Baz wrote:
Here's a small bug I discovered:
- Run
echo 'a\nb\nc\nd' | ./fzy- Type `aa<Ctrl-Space><Backspace><Enter>
[1] 566797 done echo 'a\nb\nc\nd' | 566798 segmentation fault (core dumped) ./fzy-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/jhawthorn/fzy/pull/124#issuecomment-542234314
I was on master but I switched to multiselect branch and still can reproduce this every time
What is printed for you in this case, aa?
- I enter
aaas the search query, so that there are no choices available that match the query - I press the multi-select key
- I press
<Backspace>so that the query is now simplya. Theachoice reappears - I press
<Enter>andais returned (that being the only choice)
On Tue, 15 Oct 2019 at 07:22:20 AM -0700, Maxim Baz wrote:
What is printed for you in this case,
aa?-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/jhawthorn/fzy/pull/124#issuecomment-542237927
Thanks, with the latest code everything works well now, and I love how Ctrl-t scrolls and even wraps to the first entry when you select the last one 👍
Great job!
Is this gonna be merged to master?
@jhawthorn
Any update on when/if this will be pushed into master? This is a great feature.
Why was C-t chosen over the tab key (what fzf uses)?