Skip to content
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

Killing 'fd' during long-running search takes long #210

Closed
sharkdp opened this issue Jan 2, 2018 · 2 comments
Closed

Killing 'fd' during long-running search takes long #210

sharkdp opened this issue Jan 2, 2018 · 2 comments
Labels
Milestone

Comments

@sharkdp
Copy link
Owner

sharkdp commented Jan 2, 2018

If there are only very little search results and I press Ctrl-C, fd does not stop. The process only seems to exit when the next search result is found (and new output is generated).

This can be tested with

> fd --follow non-existing-pattern /
# try to kill the process with Ctrl-C
@sharkdp sharkdp added the bug label Jan 2, 2018
@sharkdp
Copy link
Owner Author

sharkdp commented Jan 2, 2018

This seems to be related to the changes in c0bfc65

@Doxterpepper Do you have any idea how we could exit immediately (instead of waiting for the next output)?

@sharkdp sharkdp added this to the 6.2.0 milestone Jan 2, 2018
@Doxterpepper
Copy link
Contributor

Doxterpepper commented Jan 3, 2018

Yea this is kinda a big bug, if fd searches a large enough directory and only one item is to be found it will never exit via ctrl-c until it finds that one entry. That could be a really long time and may be a pretty common use case. To fix this we need to exit from the sender thread gracefully as well when we handle ctrl-c.

I'm currently looking into this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants