Files
neovim/runtime/doc
github-actions[bot] fdd5178581 [Backport release-0.7] introduce $NVIM, unset $NVIM_LISTEN_ADDRESS (#18986)
feat(server): introduce $NVIM

PROBLEM
------------------------------------------------------------------------
$NVIM_LISTEN_ADDRESS has conflicting purposes as both a parameter ("the
current process should listen on this address") and a descriptor ("the
current process is a child of this address").

This contradiction means the presence of NVIM_LISTEN_ADDRESS is
ambiguous, so child Nvim always tries to listen on its _parent's_
socket. This is the cause of lots of  "Failed to start server" spam in
our test/CI logs:

    WARN  2022-04-30… server_start:154: Failed to start server: address already in use: \\.\pipe\nvim-4480-0
    WARN  2022-04-30… server_start:154: Failed to start server: address already in use: \\.\pipe\nvim-2168-0

SOLUTION
------------------------------------------------------------------------

1. Set $NVIM to the parent v:servername, *only* in child processes.
   - Now the correct way to detect a "parent" Nvim is to check for $NVIM.
2. Do NOT set $NVIM_LISTEN_ADDRESS in child processes.
3. On startup if $NVIM_LISTEN_ADDRESS exists, unset it immediately after
   server init.
4. Open a channel to parent automatically, expose it as v:parent.

Fixes #3118
Fixes #6764
Fixes #9336
Ref https://github.com/neovim/neovim/pull/8247#issuecomment-380275696
Ref #8696

(cherry picked from commit b9d97f5951)

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2022-06-16 18:30:08 -07:00
..
2021-09-23 06:59:30 -07:00
2022-03-14 08:16:01 +09:00
2022-02-27 11:56:30 +01:00
2022-02-27 11:56:30 +01:00
2022-03-20 10:48:10 +01:00
2021-09-10 08:48:27 +02:00
2022-02-27 11:56:30 +01:00
2022-02-27 11:56:30 +01:00
2018-10-29 09:55:07 +01:00
2022-01-11 14:14:17 +01:00
2022-02-27 11:56:30 +01:00
2021-09-09 00:37:59 -07:00
2022-01-04 11:07:40 -07:00
2018-08-25 15:25:49 +02:00
2021-04-28 21:29:57 -04:00
2022-01-11 14:14:17 +01:00
2022-03-25 19:57:59 +01:00
2019-03-26 19:55:33 +01:00
2018-10-29 09:55:07 +01:00
2022-01-29 23:15:22 +00:00
2018-10-29 09:55:07 +01:00
2018-10-29 09:55:07 +01:00
2015-08-15 15:25:30 -03:00
2021-11-17 10:02:59 +01:00
2022-02-27 11:56:30 +01:00
2019-03-26 19:55:33 +01:00
2022-03-17 13:21:24 +08:00
2021-09-10 08:48:27 +02:00
2019-08-02 16:20:22 +02:00
2022-02-27 11:56:30 +01:00
2022-02-27 11:56:30 +01:00
2022-02-27 11:56:30 +01:00
2022-03-20 10:48:10 +01:00
2022-01-29 23:15:22 +00:00
2022-02-27 11:56:30 +01:00
2022-04-15 12:35:06 +02:00
2022-02-27 11:56:30 +01:00
2021-04-27 09:21:30 -04:00
2021-05-02 13:00:38 -04:00
2021-05-01 23:19:57 -04:00
2022-02-27 11:56:30 +01:00
2019-08-02 16:20:22 +02:00
2021-09-08 07:24:12 -07:00
2021-05-01 22:29:02 -04:00
2021-05-02 12:53:49 -04:00
2021-11-22 10:53:57 +01:00
2021-05-01 22:29:03 -04:00
2021-04-27 09:21:33 -04:00
2018-10-29 10:01:44 +01:00
2021-04-29 09:27:19 -04:00
2018-10-29 10:01:44 +01:00
2022-03-20 10:48:10 +01:00
2021-04-29 20:42:16 -04:00
2021-04-29 20:42:16 -04:00
2018-10-29 10:01:44 +01:00
2021-04-29 20:42:16 -04:00
2019-03-26 19:55:33 +01:00
2021-04-27 09:21:34 -04:00
2021-05-01 23:19:57 -04:00