-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[fish] Allow setting multi-select and list reload for history #4179
Conversation
The tests fail because the |
There seems to be some other issues, too (also with |
Thank you. I'm not a fish user, so I can't really say, but if you think there's no point in supporting older versions of fish, because it makes the code overly complex and few people actually use such old versions, let me know. |
I just figured out why |
Apparently, using |
Maybe it's because |
I originally (before the forced push of only the first commit) had a check (in the second commit) that added this parameter when What is really confusing though, is that even with that correction, running the tests locally, they inconsistently fail most of the time with:
I don't know why this happens, or why it passes some times. I must look more into it. |
A couple observations. The test ( diff --git a/shell/key-bindings.fish b/shell/key-bindings.fish
index 9039348..7f0931e 100644
--- a/shell/key-bindings.fish
+++ b/shell/key-bindings.fish
@@ -84,7 +84,7 @@ function fzf_key_bindings
'string join0 -- $i\t(string replace -a -- \n \n\t $h[$i] | string collect);' \
'end'
end
- eval (__fzfcmd) --read0 --print0 -q '(commandline)' | string replace -r '^\d*\t' '' | read -lz result
+ eval (__fzfcmd) --with-shell 'fish\ -c' --read0 --print0 -q '(commandline)' | string replace -r '^\d*\t' '' | read -lz result
and commandline -- $result
else
builtin history | eval (__fzfcmd) -q '(commandline)' | read -l result So I tried to see what's really going on by binding a diff --git a/shell/key-bindings.fish b/shell/key-bindings.fish
index 9039348..f0fb45f 100644
--- a/shell/key-bindings.fish
+++ b/shell/key-bindings.fish
@@ -84,7 +84,7 @@ function fzf_key_bindings
'string join0 -- $i\t(string replace -a -- \n \n\t $h[$i] | string collect);' \
'end'
end
- eval (__fzfcmd) --read0 --print0 -q '(commandline)' | string replace -r '^\d*\t' '' | read -lz result
+ fzf --with-shell 'fish -c' --bind 'space:reload:eval $FZF_DEFAULT_COMMAND' --read0 --print0 -q (commandline) | string replace -r '^\d*\t' '' | read -lz result
and commandline -- $result
else
builtin history | eval (__fzfcmd) -q '(commandline)' | read -l result |
e56120e
to
66373e1
Compare
I don't like this workaround - closing. |
This effectively makes CTRL-R non-blocking (the previous attempt was unsuccessful).
I reopened this because upon closer testing 0a10d14, I realized that it was still blocking. set -l cmd fzf
begin echo start; sleep 3; echo end; end | $cmd
$cmd | read -l result This becomes blocking: begin echo start; sleep 3; echo end; end | fzf | read -l result Upon further testing, I figured that this is non-blocking: set -l result (begin echo start; sleep 3; echo end; end | fzf) So I adjusted this PR with those changes, and everything is working fine locally, with the test consistently passing. But the tests here now fail with:
Any idea why this might be happening? |
I even ran the tests a few times on a VM with ubuntu-24.04.1 (same as GitHub actions): They always pass... |
I reran the task, and the test passed this time. And it constantly passes on my system. I'll see if there can be some timing issues, but anyway I think this is ready for merge. Thanks. |
The purpose of this PR is twofold: