aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2022-05-02 23:24:37 +0200
committerGitHub <noreply@github.com>2022-05-02 23:24:37 +0200
commitddf7bb24f98b468d2bc6c16c6f300570fc6530f5 (patch)
tree8d2c78c2fa94ee7c7bfd40d7cc2f00bc54801eaf /runtime
parenta1542b091dd7b919fa8524c1c909ef897dde9299 (diff)
parentad63b94b03c166f37bda477db6cbac2a9583d586 (diff)
downloadrneovim-ddf7bb24f98b468d2bc6c16c6f300570fc6530f5.tar.gz
rneovim-ddf7bb24f98b468d2bc6c16c6f300570fc6530f5.tar.bz2
rneovim-ddf7bb24f98b468d2bc6c16c6f300570fc6530f5.zip
Merge pull request #18357 from bfredl/ui_stdin
feat(ui): allow embedder to emulate "cat data | nvim -" behaviour
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*