-
Notifications
You must be signed in to change notification settings - Fork 11
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
Freeze when using "yank" function #25
Comments
Oh, that's annoying, but I think I have an idea of what might be happening. Yank functionality is implemented via trying to run a set of shell commands, in this order: Lines 11 to 16 in 6358ded
I have Does it make sense to you? You can try running There're things we can do to mitigate this issue freezing the entire app; we can put a timeout to the command, or just run it outside of the main thread. I'll implement one of them, but I'd still appreciate if you could try to spot which command is incorrect. |
I put a timeout on the command for the yank action, which is not a solution but should still be better than freezing (bb77231). Keeping the issue open since I don't exactly know if this is the problem, and even if it is we still have to figure out why it hangs. |
The timeout doesn't work as desired because System.Timeout can only interrupt Haskell code. There is a wl-copy process running starting from when I press y, but What I don't understand is why it's waiting for wl-copy to complete at all: wl-copy forks itself to run in the background (to service any paste requests), but the main process exits almost immediately with a success exit code. I'd expect that |
Very interesting. Thank you for delving in @lheckemann.
This is good to know, but my mental model was that System.Process runs the process on a separate Haskell thread and communicates it via STM; so it should be interruptible as it's not a long-running FFI call.
Maybe. But we are not doing anything fancy, other than calling Lines 21 to 24 in bb77231
But clearly there's something I'm missing in this picture, as I can not explain why it blocks. So, I'll have a look at it later this weekend, and try to reproduce the issue (but do feel free to experiment more/fix if you're feel like it) |
@lheckemann I just checked, and it seems like grabbing stdout (and stderr) of the child process was causing the But I do not know whether it fixed the |
Tested it on my side, on X11 using xclip (it was freezing for me as well), and now it doesn't freeze anymore 👍 |
I'm tentatively marking this as done as per @bew's comment; @lheckemann please feel free to reopen it if the new version doesn't solve your issue! |
Works wonderfully, thanks! |
Whenever I use the yank function, the store path is copied to the clipboard correctly, but nix-tree stops responding to any further input. I'm not sure how to debug any further, any suggestions?
The text was updated successfully, but these errors were encountered: