-
-
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
Issue with nested fzf
usage in bash script causing script to halt
#3685
Comments
Interesting. The reason that the curl command in Line 779 in 25e6105
This small buffer is already filled with There is no particular reason the buffer size should be 10, I just thought it was enough. We can increase it to a larger value to prevent this from happening. But how large should it be? 1k? 10k? 100k? Can you share what you were trying to implement? |
Thank you, increasing the buffer size does work.
The script is designed to search GitHub code and list the results. The header updates to reflect the The hotkey ⌃ Control + H allows viewing of past queries and select one. Refer to the GIF below for further clarity. The code is present here. For the time being, I have implemented the interactive history by LangLangBart · Pull Request #2 · LangLangBart/gh-find-code · GitHub |
I'm thinking of increasing the buffer size to 1K. Do you think this will be enough? We can't make it absurdly large because that would waste memory. |
I'm also going to put a timeout on POST requests. So with the channel size 10, $ fzf --listen --bind 'start:execute(for i in $(seq 1000); do curl -if localhost:$FZF_PORT -d up || break; done)+abort'
HTTP/1.1 200 OK
HTTP/1.1 200 OK
HTTP/1.1 200 OK
HTTP/1.1 200 OK
HTTP/1.1 200 OK
HTTP/1.1 200 OK
HTTP/1.1 200 OK
HTTP/1.1 200 OK
HTTP/1.1 200 OK
HTTP/1.1 200 OK
HTTP/1.1 503 Service Unavailable
curl: (22) The requested URL returned error: 503 |
Indeed, tests with 100 as the parameter (
A timeout feature would indeed be a valuable addition. |
Alright, let's settle with 100 with 2-second timeout. 1K does seem a bit too much to be honest. We'll see if anyone hits the limit. |
man fzf
)Info
Problem / Steps to reproduce
I am encountering an issue when trying to use
fzf
withinfzf
in a bash script. The script stopswhen I make a second selection from ⌃ Control + H, and continues only when ⌃ Control + C
is pressed.
The idea I am pursuing is using the
--history
flag read from my past queries and make a selection,this selection will then replace my current query. For simplicity, the script has been reduced to
the following:
Here is the GIF of the script in action:
A
.query
is still running, I press ⌃ Control + H again and selectB
.Alternatives
The idea worked when modifying the script using the
--expect
flag.Related issue(s):
The text was updated successfully, but these errors were encountered: