-
Notifications
You must be signed in to change notification settings - Fork 61
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
wl-copy seems to be mishandling stderr
#245
Comments
stderr
stderr
see bugaevc/wl-clipboard#245 Signed-off-by: Krzysztof Nazarewski <[email protected]>
Hi!
Perhaps you could clarify what you mean by "mishandling" in this context? You're probably unhappy about the forked instance of
Well, yes, if you pass the stdout pipe as stderr too (which is what |
Your explanation makes sense. I would expect:
Is there a particular reason why
|
We keep stderr open to be able to report errors, if any. Though it's possible that I will change my mind about this, given the never-ending torrent of issues that people file about it 🙂
|
oh, I was under the impression the clipboard is stored in a system session or something like that instead of within |
Why does the process need to stick around after |
So I wondered if it was the forking, which eventually led me here. I was trying to get write a simple kakoune wl-copy integration: https://stackoverflow.com/questions/41396835/how-do-i-yank-to-system-clipboard-in-kakoune When I saw this answer, I was like "what in the world why is the wl-copy example so much more complicated, who cares about stdout/stderr and forking": hook global RegisterModified '"' %{ nop %sh{
case $(uname) in
Linux)
wl-copy -n "$kak_main_reg_dquote" > /dev/null 2>&1 & ;;
Darwin)
printf "%s" "$kak_main_reg_dquote" | pbcopy ;;
esac
}} After trial and error, I believe this should be the correct line: wl-copy --foreground -- "$kak_main_reg_dquote" however, adding This seems to be the correct incantation:
... this is excessively weird. Please don't keep this behavior. If there's no possibility of further input (i.e., stdin is a closed pipe or a non-pipe file descriptor that has hit EOF, or was never provided) ... I do not see why wl-copy should ever hang around. |
Seems like
wl-copy
is doing something wrong withstderr
/logging handling.I am trying to write a clipboard anonymization script that should go like:
Initially I thought I don't understand bash process substitution and/or redirection, but after a few attempts of solving it over the months I pinned it down to
wl-copy
mishandlingstderr
in some way.Basically above snippet results in the script hanging up indefinitely unless I augment the
wl-copy
call with2>/dev/null
(or any other file like2>/tmp/wl-copy.stderr
).For minimal reproducible examples, this is working:
while this is not:
This might be related to following:
The text was updated successfully, but these errors were encountered: