From bd8d43c6fef868ad5ed50a79deb0f7adc1f5e53a Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Wed, 18 Jul 2018 13:31:23 +0200 Subject: startup: wait for embedder before executing startup commands and files Give embeders a chance to set up nvim, by processing a request before startup. This allows an external UI to show messages and prompts from --cmd and buffer loading (e.g. swap files) --- runtime/doc/starting.txt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'runtime/doc') diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt index 3440131642..275b08b5dd 100644 --- a/runtime/doc/starting.txt +++ b/runtime/doc/starting.txt @@ -349,7 +349,16 @@ argument. *--embed* --embed Use stdin/stdout as a msgpack-RPC channel, so applications can embed and control Nvim via the |rpc-api|. Implies |--headless|. - Equivalent to: > + + Nvim will wait for a single request before sourcing startup + files and reading buffers. This is mainly so that UIs can call + `nvim_ui_attach` so that the UI can show startup messages + and possible swap file dialog for the first loaded file. In + addition, a `nvim_get_api_info` call before the `nvim_ui_attach` + call is also allowed, so that UI features can be safely + detected by the UI. + + To avoid this behavior, this alterative could be used instead: > nvim --headless --cmd "call stdioopen({'rpc': v:true})" < See also |channel-stdio|. -- cgit