aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc/nvim_terminal_emulator.txt
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2022-05-03 15:08:35 +0200
committerGitHub <noreply@github.com>2022-05-03 06:08:35 -0700
commit4fb48c5654d9ffbffbdcdd80d0498b1ea3c8e68b (patch)
tree8a1222f6ed9a170ca2d151afcd911dfd01affdaf /runtime/doc/nvim_terminal_emulator.txt
parentb5c15ba7e5266bdd742a835d82525d4625980d4d (diff)
downloadrneovim-4fb48c5654d9ffbffbdcdd80d0498b1ea3c8e68b.tar.gz
rneovim-4fb48c5654d9ffbffbdcdd80d0498b1ea3c8e68b.tar.bz2
rneovim-4fb48c5654d9ffbffbdcdd80d0498b1ea3c8e68b.zip
feat(server): set $NVIM, unset $NVIM_LISTEN_ADDRESS #11009
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
Diffstat (limited to 'runtime/doc/nvim_terminal_emulator.txt')
-rw-r--r--runtime/doc/nvim_terminal_emulator.txt18
1 files changed, 9 insertions, 9 deletions
diff --git a/runtime/doc/nvim_terminal_emulator.txt b/runtime/doc/nvim_terminal_emulator.txt
index 0e2b048541..49e29111c6 100644
--- a/runtime/doc/nvim_terminal_emulator.txt
+++ b/runtime/doc/nvim_terminal_emulator.txt
@@ -25,23 +25,23 @@ Start *terminal-start*
There are several ways to create a terminal buffer:
-- Invoke the |:terminal| command.
-- Call the |termopen()| function.
-- Edit a file with a name matching `term://(.{-}//(\d+:)?)?\zs.*`.
- For example:
->
+- Run the |:terminal| command.
+- Call the |nvim_open_term()| or |termopen()| function.
+- Edit a "term://" buffer. Examples: >
:edit term://bash
:vsplit term://top
-<
- Note: The "term://" pattern is handled by a BufReadCmd handler, so the
- |autocmd-nested| modifier is required to use it in an autocmd. >
+
+< Note: To open a "term://" buffer from an autocmd, the |autocmd-nested|
+ modifier is required. >
autocmd VimEnter * ++nested split term://sh
-< This is only mentioned for reference; use |:terminal| instead.
+< (This is only mentioned for reference; use |:terminal| instead.)
When the terminal starts, the buffer contents are updated and the buffer is
named in the form of `term://{cwd}//{pid}:{cmd}`. This naming scheme is used
by |:mksession| to restore a terminal buffer (by restarting the {cmd}).
+The terminal environment is initialized as in |jobstart-env|.
+
==============================================================================
Input *terminal-input*