diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-08-11 19:50:37 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-08-11 19:50:37 +0200 |
commit | 1ccd8fff8acfbd5df0fc0e9b4d288af84e51233e (patch) | |
tree | 909b2433229aa72e87bd9d23bd88db9e1e8a9f57 /runtime/doc/channel.txt | |
parent | 05aafed54b50b602315ae55d83a7d089804cecb0 (diff) |
Update runtime files.
Diffstat (limited to 'runtime/doc/channel.txt')
-rw-r--r-- | runtime/doc/channel.txt | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/runtime/doc/channel.txt b/runtime/doc/channel.txt index b9af2e6d82..4e47ef1497 100644 --- a/runtime/doc/channel.txt +++ b/runtime/doc/channel.txt @@ -1,4 +1,4 @@ -*channel.txt* For Vim version 8.0. Last change: 2017 Jul 22 +*channel.txt* For Vim version 8.0. Last change: 2017 Aug 11 VIM REFERENCE MANUAL by Bram Moolenaar @@ -475,6 +475,11 @@ it like this: > Without the handler you need to read the output with |ch_read()| or |ch_readraw()|. You can do this in the close callback, see |read-in-close-cb|. +Note that if the job exits before you read the output, the output may be lost. +This depends on the system (on Unix this happens because closing the write end +of a pipe causes the read end to get EOF). To avoid this make the job sleep +for a short while before it exits. + The handler defined for "out_cb" will not receive stderr. If you want to handle that separately, add an "err_cb" handler: > let job = job_start(command, {"out_cb": "MyHandler", @@ -489,11 +494,6 @@ started job gets the focus. To avoid that, use the `foreground()` function. This might not always work when called early, put in the callback handler or use a timer to call it after the job has started. -Depending on the system, starting a job can put Vim in the background, the -started job gets the focus. To avoid that, use the `foreground()` function. -This might not always work when called early, put in the callback handler or -use a timer to call it after the job has started. - You can send a message to the command with ch_evalraw(). If the channel is in JSON or JS mode you can use ch_evalexpr(). |