-
Notifications
You must be signed in to change notification settings - Fork 265
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
vis_pipe() doesn't correctly handle programs that fork to the background #929
Comments
Once we have written all data we should properly close the (correct) pipe. Before we wrongly closed the pipe connected to the standard output stream. More generally, we currently do not listen for child process termination, but instead wait until all the connected pipes are closed. This might be problematic in case the external process keeps hold of the standard I/O file descriptors. One particular example of this is wl-copy(1). See #929
Thanks for the report. I briefly looked into the issue and the problem is that we don't actually wait for process termination, but until all connected pipes to the standard I/O streams are closed. However, wl-copy forks to the background, but doesn't close its standard error file descriptor which means we keep waiting for it. This can be reproduced with the following shell pipe line which does not terminate.
A similar problem was recently fixed for the standard input and output descriptors in a wl-copy commit. If you apply the same changes for standard error, it should work. It could also be argued that we should close our end of the pipe once we notice the exit of the original process. |
Sorry for being a little late, but thanks for the response. Do you think we should handle possible error messages from stderr as suggested by bugaevc? |
@ninewise, @caioraposo Is this still relevant, wasn’t this already fixed? |
@mcepl I still have this issue so I put the following in my visrc:
|
|
Once we have written all data we should properly close the (correct) pipe. Before we wrongly closed the pipe connected to the standard output stream. More generally, we currently do not listen for child process termination, but instead wait until all the connected pipes are closed. This might be problematic in case the external process keeps hold of the standard I/O file descriptors. One particular example of this is wl-copy(1). See martanne#929
I'm closing this issue since I believe this should have been fixed by 0cccd6e. If its still an issue it can be reopened along with the exact steps needed to recreate it. |
I can still reproduce the hanging wl-copy process with the current master.
Steps to reproduce
|
Hello, repeating what I've said in bugaevc/wl-clipboard#110:
Redirecting |
I see, this makes more sense now. Right now |
Still cannot reproduce: |
For me your example unfortunately still hangs even.
But I haven't investigated further.
The wl-clipboard issue tracker has a lot of open issues, which seem related.
|
I can still reproduce ( vis 004800e wl-clipboard 2.2.0), and adding |
Once we have written all data we should properly close the (correct) pipe. Before we wrongly closed the pipe connected to the standard output stream. More generally, we currently do not listen for child process termination, but instead wait until all the connected pipes are closed. This might be problematic in case the external process keeps hold of the standard I/O file descriptors. One particular example of this is wl-copy(1). See martanne#929
Once we have written all data we should properly close the (correct) pipe. Before we wrongly closed the pipe connected to the standard output stream. More generally, we currently do not listen for child process termination, but instead wait until all the connected pipes are closed. This might be problematic in case the external process keeps hold of the standard I/O file descriptors. One particular example of this is wl-copy(1). See martanne#929
Using wl-copy results in a weird behavior where it keeps receiving text through the command prompt.
Tested with neovim and acme, it works as expected.
wl-paste works.
vis: v0.7
wlroots: v0.12
sway: v1.15
The text was updated successfully, but these errors were encountered: