nvim --version
: 0.3.2$TERM
: screen-256colornvim -u NORC
1) mkfifo /tmp/myfifo
2) Open nvim -u NORC test.vim
and save the buffer
3) Copy the following script and the source the buffer
function! s:OnData(id, data, event)
echo join(a:data, '\n')
endfunction
let id = sockconnect('pipe', '/tmp/myfifo', { 'on_data': function('s:OnData') })
The pipe works as expected when running the following from a shell.
echo "hello" > /tmp/myfifo &
cat /tmp/myfifo
Neovim throws this error: connection failed: connection refused
Be able to connect to the named pipe.
I think sockconnect()
on non-RPC pipes doesn't work yet. e3c4c8a90e04316d1290729f6952a89ea2733cb6
But it should work with a TCP socket.
I think sockconnect() on non-RPC pipes doesn't work yet.
@justinmk It does, by virtue of just using a shared code path for TCP sockets and named pipes. Why would we do otherwise? How does a _flaky_ test indicate missing functionality? (How could the test ever be written in the first place, if the functionality didn't exist?)
mkfifo
makes a FIFO object, not a named pipe. We could support it, but that would require separate code, as it is unidirectional, and we would connect to either the reading or writing end specifically.
Thanks for the clarification!
Most helpful comment
@justinmk It does, by virtue of just using a shared code path for TCP sockets and named pipes. Why would we do otherwise? How does a _flaky_ test indicate missing functionality? (How could the test ever be written in the first place, if the functionality didn't exist?)
mkfifo
makes a FIFO object, not a named pipe. We could support it, but that would require separate code, as it is unidirectional, and we would connect to either the reading or writing end specifically.