aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2022-04-22 20:56:31 +0200
committerbfredl <bjorn.linse@gmail.com>2022-05-02 22:19:41 +0200
commitad63b94b03c166f37bda477db6cbac2a9583d586 (patch)
tree49ee0ca3d359e52630d7e30e5dbb5a53275640b1 /runtime
parent619c8f4b9143e4dea0fb967ccdce594e14956ed3 (diff)
downloadrneovim-ad63b94b03c166f37bda477db6cbac2a9583d586.tar.gz
rneovim-ad63b94b03c166f37bda477db6cbac2a9583d586.tar.bz2
rneovim-ad63b94b03c166f37bda477db6cbac2a9583d586.zip
refactor(ui): simplify stdin handling
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/ui.txt18
1 files changed, 18 insertions, 0 deletions
diff --git a/runtime/doc/ui.txt b/runtime/doc/ui.txt
index f9110cd59b..8014199dc5 100644
--- a/runtime/doc/ui.txt
+++ b/runtime/doc/ui.txt
@@ -52,6 +52,11 @@ with these (optional) keys:
`term_name` Sets the name of the terminal 'term'.
`term_colors` Sets the number of supported colors 't_Co'.
`term_background` Sets the default value of 'background'.
+ `stdin_fd` Read buffer from `fd` as if it was a stdin pipe
+ This option can only used by |--embed| ui,
+ see |ui-startup-stdin|.
+
+
Specifying an unknown option is an error; UIs can check the |api-metadata|
`ui_options` key for supported options.
@@ -140,6 +145,19 @@ procedure:
Inside this request handler, the UI can safely do any initialization before
entering normal mode, for example reading variables set by init.vim.
+ *ui-startup-stdin*
+An UI can support the native read from stdin feature as invoked with
+`command | nvim -` for the builtin TUI. |--|
+The embedding process can detect that its stdin is open to a file which
+not is a terminal, just like nvim does. It then needs to forward this fd
+to Nvim. As fd=0 is already is used to send rpc data from the embedder to
+Nvim, it needs to use some other file descriptor, like fd=3 or higher.
+
+Then, `stdin_fd` option should be passed to `nvim_ui_attach` and nvim will
+implicitly read it as a buffer. This option can only be used when Nvim is
+launched with `--embed` option, as described above.
+
+
==============================================================================
Global Events *ui-global*