Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions doc/terminal.jax
Original file line number Diff line number Diff line change
Expand Up @@ -947,6 +947,20 @@ term_start({cmd} [, {options}]) *term_start()*
をそれぞれ 1 つずつしか受け付けず、標準エラー出力用の個別のハ
ンドルがないためである。

Note: term_start() は、コールバックに常に RAW モードを使用す
る。"out_cb" と "err_cb" は、OS から読み取った生のデータチャン
クを受け取る。1 つのコールバック呼び出しには、NL で区切られた
複数の行が含まれる場合があり (pty 経由の標準出力の場合)、各行
には行規律 (ONLCR) による末尾の CR が含まれる場合がある。行ご
との処理が必要な場合は、コールバックで "msg" を NL で分割し、
末尾の CR を削除する必要がある。
例: >
func Handle(ch, msg)
for line in split(a:msg, "\n")
echom substitute(line, '\r$', '', '')
endfor
endfunc
<
追加のオプションは以下のとおり:
"term_name" (コマンド名の代わりに使用される)バッファ
名に使用する名前。
Expand Down
14 changes: 14 additions & 0 deletions en/terminal.txt
Original file line number Diff line number Diff line change
Expand Up @@ -965,6 +965,20 @@ term_start({cmd} [, {options}]) *term_start()*
input and one output handle, with no separate handle for
stderr.

Note: term_start() always uses RAW mode for its callbacks.
"out_cb" and "err_cb" receive the raw chunk of data as read
from the OS. A single callback invocation may contain
multiple lines separated by NL, and (for stdout via a pty)
each line may have a trailing CR from the line discipline
(ONLCR). If per-line handling is desired, the callback must
split "msg" on NL and strip the trailing CR itself.
Example: >
func Handle(ch, msg)
for line in split(a:msg, "\n")
echom substitute(line, '\r$', '', '')
endfor
endfunc
<
There are extra options:
"term_name" name to use for the buffer name, instead
of the command name.
Expand Down