summaryrefslogtreecommitdiffstats
path: root/runtime/doc/terminal.txt
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-09-26 23:08:54 +0200
committerBram Moolenaar <Bram@vim.org>2019-09-26 23:08:54 +0200
commitd2842ea60bd608b7f9ec93c77d3f36a8e3bf5fe9 (patch)
treed10208c36706ae29c65fba43fbf02aeced49eccd /runtime/doc/terminal.txt
parentd2c1fb476d5816db129eb428ffef6a81027eb13a (diff)
patch 8.1.2080: the terminal API is limited and can't be disabledv8.1.2080
Problem: The terminal API is limited and can't be disabled. Solution: Add term_setapi() to set the function prefix. (Ozaki Kiichi, closes #2907)
Diffstat (limited to 'runtime/doc/terminal.txt')
-rw-r--r--runtime/doc/terminal.txt24
1 files changed, 20 insertions, 4 deletions
diff --git a/runtime/doc/terminal.txt b/runtime/doc/terminal.txt
index c0caa67971..ab26631e27 100644
--- a/runtime/doc/terminal.txt
+++ b/runtime/doc/terminal.txt
@@ -1,4 +1,4 @@
-*terminal.txt* For Vim version 8.1. Last change: 2019 Sep 20
+*terminal.txt* For Vim version 8.1. Last change: 2019 Sep 26
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -222,7 +222,7 @@ Command syntax ~
Vim width (no window left or right of
the terminal window) this value is
ignored.
- ++eof={text} when using [range]: text to send after
+ ++eof={text} When using [range]: text to send after
the last line was written. Cannot
contain white space. A CR is
appended. For MS-Windows the default
@@ -234,6 +234,10 @@ Command syntax ~
++type={pty} (MS-Windows only): Use {pty} as the
virtual console. See 'termwintype'
for the values.
+ ++api={expr} Permit the function name starting with
+ {expr} to be called as |terminal-api|
+ function. If {expr} is empty then no
+ function can be called.
If you want to use more options use the |term_start()|
function.
@@ -701,6 +705,15 @@ term_sendkeys({buf}, {keys}) *term_sendkeys()*
GetBufnr()->term_sendkeys(keys)
+term_setapi({buf}, {expr}) *term_setapi()*
+ Set the function name prefix to be used for the |terminal-api|
+ function in terminal {buf}. For example: >
+ :call term_setapi(buf, "Myapi_")
+ :call term_setapi(buf, "")
+<
+ The default is "Tapi_". When {expr} is an empty string then
+ no |terminal-api| function can be used for {buf}.
+
term_setansicolors({buf}, {colors}) *term_setansicolors()*
Set the ANSI color palette used by terminal {buf}.
{colors} must be a List of 16 valid color names or hexadecimal
@@ -843,6 +856,9 @@ term_start({cmd} [, {options}]) *term_start()*
color modes. See |g:terminal_ansi_colors|.
"tty_type" (MS-Windows only): Specify which pty to
use. See 'termwintype' for the values.
+ "term_api" function name prefix for the
+ |terminal-api| function. See
+ |term_setapi()|.
Can also be used as a |method|: >
GetCommand()->term_start()
@@ -902,9 +918,9 @@ Currently supported commands:
Call a user defined function with {argument}.
The function is called with two arguments: the buffer number
of the terminal and {argument}, the decoded JSON argument.
- The function name must start with "Tapi_" to avoid
+ By default, the function name must start with "Tapi_" to avoid
accidentally calling a function not meant to be used for the
- terminal API.
+ terminal API. This can be changed with |term_setapi()|.
The user function should sanity check the argument.
The function can use |term_sendkeys()| to send back a reply.
Example in JSON: >