-
Notifications
You must be signed in to change notification settings - Fork 183
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
fix copy command blocking #553
Conversation
Do you mean either stdout or stderr? This PR doesn't seem to change stdin. I wonder why this is the case, |
Oops yes, i meant stdout, basically any attempt at reading the commands output causes this freeze for me on Linux. Works fine on MacOS for me aswell |
Look like |
Thanks for the fix @juliamertz! |
Hey all, Posting this more as a convenience for anyone else who might encounter this issue, hope this helps someone. diff --git a/spotify_player/src/event/clipboard.rs b/spotify_player/src/event/clipboard.rs
index fb06cfa..8d14f68 100644
--- a/spotify_player/src/event/clipboard.rs
+++ b/spotify_player/src/event/clipboard.rs
@@ -100,7 +100,7 @@ pub fn get_clipboard_provider() -> Box<dyn ClipboardProvider> {
} else if env_var_is_set("DISPLAY") && binary_exists("xsel") {
Box::new(CommandProvider {
paste_command: Command::new("xsel", &["-o", "-b"]),
- copy_command: Command::new("xsel", &["--nodetach", "-i", "-b"]),
+ copy_command: Command::new("xsel", &["-i", "-b"]),
})
} else {
#[cfg(target_os = "windows")]
|
@dashaw92 I can confirm the same happens on my system, i had previously only tested with xclip. the fix also seems to be working fine for me. edit: |
Thank you. |
Fixes #538. It turns out that
child.wait_with_output()
blocks for a long time when either stdin or stderr is piped. I’ve tried multiple workarounds, but they all yield the same result.This fix resolves the blocking issue, though we won't be able to read any output, making error messages completely useless.
Interestingly, when there is actually an error (e.g., passing invalid arguments), it doesn’t block and correctly reads from stderr.
I can share a small reproduction of this issue if that would be helpful.