Mercurial > vim
diff runtime/doc/channel.txt @ 12045:444ad56c0cac
Update runtime files.
commit https://github.com/vim/vim/commit/1ccd8fff8acfbd5df0fc0e9b4d288af84e51233e
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Aug 11 19:50:37 2017 +0200
Update runtime files.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Fri, 11 Aug 2017 20:00:05 +0200 |
parents | 2796a2c9fc17 |
children | a62eeee5f116 |
line wrap: on
line diff
--- 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 th 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().