neovim-qt: MacOS: "QLocalSocket::connectToServer: Invalid name"
Is it possible to add the ability for Neovim-Qt to connect to a Neovim instance that’s listening on a filesystem or domain socket?
Currently, if I try to use --server /path/to/socket
or --server @sockname
you get an error saying that the listening address is invalid:
nvim -i NONE -u NONE --headless --listen ./nvim.sock &
nvim-qt --server ./nvim.sock
nvim -i NONE -u NONE --headless --listen @nvim &
nvim-qt --server @nvim
This error happens on Neovim-Qt v0.2.16.1 with Neovim v0.5.0.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 23 (15 by maintainers)
Commits related to this issue
- Convert socket paths to absolute for QLocalSocket Attempting to connect to a local socket in UNIX systems using a relative path - this happens because Qt considers relative socket paths as being rela... — committed to equalsraf/neovim-qt by deleted user 2 years ago
- Convert socket paths to absolute for QLocalSocket Attempting to connect to a local socket in UNIX systems using a relative path - this happens because Qt considers relative socket paths as being rela... — committed to equalsraf/neovim-qt by deleted user 2 years ago
- Convert socket paths to absolute for QLocalSocket Attempting to connect to a local socket in UNIX systems using a relative path - this happens because Qt considers relative socket paths as being rela... — committed to equalsraf/neovim-qt by deleted user 2 years ago
I opened a PR to fix this, tests are looking good. I’ll merge once CI is done.
This seems to be the same as seen in this bug https://bugreports.qt.io/browse/QTBUG-50877. From the testing earlier it seems there are two distinct cases, but the upstream issue does not go into them and I was unable to find the source for this.
To verify try this:
nvim-qt --server nvimXXXX/0
(use the path you saw above)It seems that Qt assumes relative paths passed QLocalSocket are relative to /tmp/.
The only solution that I can think of is making the path absolute as part of the call (exclude windows for now).
@gwerbin
Yes, it was only an example,
nvr
uses filesystem socket I think.I think you command
nvim -i NONE -u NONE --headless --listen ./nvim.sock
is the problem. On my Linux machine, the file is not created. I’ll dig up a filesystem socket example, that case should be supported and working.