mhinz / neovim-remote

:ok_hand: Support for --remote and friends.
MIT License
1.73k stars 83 forks source link

How to use it on the windows I get the fork issue? #132

Closed woshichuanqilz closed 4 years ago

woshichuanqilz commented 4 years ago
pid = os.fork()
AttributeError: module 'os' has no attribute 'fork'

Here is the error msg I got. I want to use the nvr on win 10 for neovim, so I can open a new file in the new tab in current neovim

mhinz commented 4 years ago

Right, the README mentions:

_If the targeted address does not exist, nvr starts a new process by running "nvim". You can change the command by setting $NVR_CMD. (This requires forking, so it won't work on Windows.)_

Putting it in a nutshell, Windows is not specifically supported, but most features don't require any Windows-specific features. I have no Windows to test things, though.

So, that's only if nvr is starting a new process (use nvr --nostart to avoid that). You should still be able to specfify an existing process with nvr ---servername .... Check :echo v:servername in the running nvim to get the server name (as I don't know if nvr --serverlist is working on Windows either).

mhinz commented 4 years ago

I'm closing this, as there is no way to fork on WIndows, unless someone else implements a way around it.

But as said above, opening a new file in another process should work even on Windows, since no forking is needed for that.

It should be just nvr --servername ADDRESS my_file, whereas ADDRESS is :echo v:servername from the running nvim process. Or you make the nvim process start with a given server name. E.g. nvim --listen localhost:12345 (or NVIM_LISTEN_ADDRESS=localhost:12345 nvim for older Nvims). Then you the accompanying call would be nvr --servername localhost:12345 my_file.

(If there are further questions, feel free to ask them in here, even if the issue is closed.)