You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Job: Output lost if program being run was installed via 'snap'. #672
This was a weird one to try and debug, reproduction requires a Linux system with snap installed, which likely means some Debian derived distribution.
To most easily reproduce, install jq via apt, and yq via snap, save the following as something like /tmp/snap_output_lost.lua, and in neovim run something like :=luafile /tmp/snap_output_lost.lua:
On my system, the output from jq is printed, and the output from yq is lost.
Which leads to the next question: Why?
(This took a bit to figure out.)
If you run some long running program installed via snap, launch it with the above, and look at /proc/<pid>/fd/[012], you'll find that they are all sockets.
I'm not yet sure why that matters, but a script that redirects everything to force stdout and stderr to be pipes instead of sockets seems to work for me:
Digging through the plenary.nvim, neovim, and libuv source, I think that the right answer is to not use uv.new_pipe for stdout and stderr, and probably not stdin, though that's more complicated.
Instead we should probably be using uv.pipe, which returns two FDs. One of those we should pass to uv.pipe_open and use for the read loops, and the other should be passed as the stdout and stderr FDs, either as raw integers, or after using uv.pipe_open on them and using the resulting uv_pipe_t.
Naturally, all of the examples in the neovim documentation use uv.new_pipe. :)
Activity
zelch commentedon Nov 16, 2025
Digging through the plenary.nvim, neovim, and libuv source, I think that the right answer is to not use uv.new_pipe for stdout and stderr, and probably not stdin, though that's more complicated.
Instead we should probably be using uv.pipe, which returns two FDs. One of those we should pass to uv.pipe_open and use for the read loops, and the other should be passed as the stdout and stderr FDs, either as raw integers, or after using uv.pipe_open on them and using the resulting uv_pipe_t.
Naturally, all of the examples in the neovim documentation use uv.new_pipe. :)