Closed sandersantema closed 4 years ago
Hello and sorry for delayed feedback
echo $NVIM_LISTEN_ADDRESS returns /tmp/nvimsocket
This is what causes problems: in your case page
is trying to connect to neovim server at /tmp/nvimsocket address which doesn't exists.
which I configured for nvr
Does nvr
reqire such configuration? I don't understand the purpose of having global $NVIM_LISTEN_ADDRESS
variable; as far as I know it should only be exposed under :term shell in order to allow clients like page
and nvr
to attach to parent neovim process.
Previously it was accepted by neovim to manually set the address on which it will listen to commands, but now this becomes deprecated in favor of --listen option.
That said, you was probably confused by README in neovim-remote repo, and manually setting NVIM_LISTEN_ADDRESS
before each nvr
invocation is not necessary
I understood the purpose of $NVIM_LISTEN_ADDRESS
a bit differently (possibly incorrect), as a way to configure nvim to always use the same server address (on which it listens). For instance launching nvim with NVIM_LISTEN_ADDRESS
unset: env NVIM_LISTEN_ADDRESS= nvim
in nvim :echo v:servername
will return /tmp/nvimnWij4Z/0
which will be different if I launch nvim again. That way if NVIM_LISTEN_ADDRESS
isn't set nvr will not know which socket to send stuff to if I understood correctly.
But it seems like --listen
is the actual option I should use and nvr seems to work perfect with that.
I tried page in the nvim terminal after launching nvim with env NVIM_LISTEN_ADDRESS= nvim --listen /tmp/nvimsocket
. Page does seems to work as a manpage for instance but without any colored text and after opening nvim focuses on another split, i.e. I have to splits open one with nothing in it and the other a terminal after opening something with page my cursor is in the window with nothing in it.
So irregardless of what NVIM_LISTEN_ADDRESS
is set to or if it is even set to something, something seems to go wrong with page for me.
Is it clear what exactly the bug is or do you still need more info? Is this bug you reported the cause?
For instance launching nvim with NVIM_LISTEN_ADDRESS unset: env NVIM_LISTEN_ADDRESS= nvim in nvim :echo v:servername will return /tmp/nvimnWij4Z/0which will be different if I launch nvim again.
That's right. But if you further launch :term
and run echo $NVIM_LISTEN_ADDRESS
on it then you will find that NVIM_LISTEN_ADDRESS
is set and it's the same as v:servername
value.
Here you can use page and nvr and they should connect to parent neovim process just fine without any /tmp/nvimsocket tweaks.
And yes, NVIM_LISTEN_ADDRESS
has two purposes, that's confusing, and that's why they introduced --listen instead of one of them.
That way if NVIM_LISTEN_ADDRESS isn't set nvr will not know which socket to send stuff to if I understood correctly.
If it isn't set then both page and nvr will launch a new neovim process and will use it. Again, /tmp/nvimsocket in this case isn't required.
Having global NVIM_LISTEN_ADDRESS
might have sense only if you want to keep a singe system-wide neovim instance that would be used by various clients like page and nvr from different terminals. For me this setup feels completely broken, so I don't see any sense in setting global NVIM_LISTEN_ADDRESS
or in using --listen option. It probably was put in neovim-remote README only to explain how things work under the hood but this turned out to be only confusing for users.
after opening nvim focuses on another split, i.e. I have to splits open one with nothing in it and the other a terminal after opening something with page my cursor is in the window with nothing in it.
This is the bug and I've reported and I've fixed it already. Fix will be included in the next version of page which I hope to release soon (maybe even today)
If I understood correctly I should be able to use
page
even without an active nvim instance, but this gives me the following error after executingpage Cargo.lock
(file from the git repo):With
env RUST_BACKTRACE=1 page Cargo.lock
:echo $NVIM_LISTEN_ADDRESS
returns/tmp/nvimsocket
which I configured fornvr
this might have something to do with this error.env NVIM_LISTEN_ADDRESS= page Cargo.lock
opens the file views it for a split second after which only an empty buffer is visible,page
outputs/tmp/neovim-page/DO-NOT-REDIRECT-OUTSIDE-OF-NVIM-TERM(--help[-W])
on the command line.env NVIM_LISTEN_ADDRESS= page -W Cargo.lock
gets the same result but without any output on the commandline.