mhinz / neovim-remote

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

cli flag to increase attach retry time #128

Closed davidosomething closed 4 years ago

davidosomething commented 4 years ago

something in my nvim is blocking the attach (maybe some plugin)

            for i in range(10):
                self.attach()
                if self.server:
                    self.started_new_process = True
                    return True
                time.sleep(0.2)

Would like to customize the 10 number by adding --retry-attach=60 also may help on a slow computer

mhinz commented 4 years ago

Before merging, please see if it's even fixing your problem: https://github.com/mhinz/neovim-remote/pull/130

Here's how you can use that branch locally:

git fetch --all
git switch attach-retry
pip3 install -e .

(Or just python3 nvr/nvr.py instead of the last line, of course.)

davidosomething commented 4 years ago

i'll use it all day and see if i get any issues :) thanks!

davidosomething commented 4 years ago

:( aw still getting issues, my neovim starts and then a few ticks later i get the couldn't attach message i also get an empty ~/.local/nvimsocket= file (my NVIM_LISTEN_ADDRESS is set to /Users/me/.local/nvimsocket)

mhinz commented 4 years ago

Maybe nvim was killed so it didn't have the chance to remove the socket itself? When there's no nvim running, just rm ~/.local/nvimsocket and try again.

NVIM_LISTEN_ADDRESS=~/.local/nvimsocket nvim
nvr --servername ~/.local/nvimsocket foo
davidosomething commented 4 years ago

i have NVIM_LISTEN_ADDRESS exported in my zshrc because i don't like to use /tmp/ my typical usage is nvr -s and yea, I end up having to rm the socket file on each crash, so I've mostly stopped using nvr with no alternative unfortunately

for more context, this is a recent issue as of the last month (i've been trying to nail down the cause since last week) https://github.com/davidosomething/dotfiles/search?q=nvr&type=Commits and I use neovim HEAD releases

mhinz commented 4 years ago

If you don't like stale unix domain sockets because of a Nvim crash, use an IP address instead. E.g. NVIM_LISTEN_ADDRESS=localhost:12345.

Nothing that relates to attaching was changed recently, so it would be nice if you could git bisect the exact commit. :)

davidosomething commented 4 years ago

gonna close, it is probably some issue with my system not allowing python to access socket