1- *channel.txt* For Vim version 8.0. Last change: 2016 Nov 07
1+ *channel.txt* For Vim version 8.0. Last change: 2016 Dec 01
22
33
44 VIM REFERENCE MANUAL by Bram Moolenaar
@@ -155,7 +155,13 @@ Use |ch_status()| to see if the channel could be opened.
155155 func MyCloseHandler(channel)
156156< Vim will invoke callbacks that handle data before invoking
157157 close_cb, thus when this function is called no more data will
158- be received.
158+ be passed to the callbacks.
159+ *channel-drop*
160+ "drop" Specifies when to drop messages:
161+ "auto" When there is no callback to handle a message.
162+ The "close_cb" is also considered for this.
163+ "never" All messages will be kept.
164+
159165 *waittime*
160166"waittime" The time to wait for the connection to be made in
161167 milliseconds. A negative number waits forever.
@@ -474,11 +480,6 @@ This depends on the system (on Unix this happens because closing the write end
474480of a pipe causes the read end to get EOF). To avoid this make the job sleep
475481for a short while before it exits.
476482
477- Note that if the job exits before you read the output, the output may be lost.
478- This depends on the system (on Unix this happens because closing the write end
479- of a pipe causes the read end to get EOF). To avoid this make the job sleep
480- for a short while before it exits.
481-
482483The handler defined for "out_cb" will not receive stderr. If you want to
483484handle that separately, add an "err_cb" handler: >
484485 let job = job_start(command, {"out_cb": "MyHandler",
@@ -543,7 +544,7 @@ You will want to do something more useful than "echomsg".
543544
544545To start another process without creating a channel: >
545546 let job = job_start(command,
546- \ {"in_io": "null", "out_io": "null", "err_io": "null"})
547+ \ {"in_io": "null", "out_io": "null", "err_io": "null"})
547548
548549 This starts {command} in the background, Vim does not wait for it to finish.
549550
@@ -605,6 +606,10 @@ See |job_setoptions()| and |ch_setoptions()|.
605606"close_cb": handler Callback for when the channel is closed. Same as
606607 "close_cb" on | ch_open() | , see | close_cb | .
607608 *job-exit_cb*
609+ "drop" Specifies when to drop messages. Same as "drop" on
610+ | ch_open() | , see | channel-drop | . For "auto" the
611+ exit_cb is not considered.
612+
608613"exit_cb": handler Callback for when the job ends. The arguments are the
609614 job and the exit status.
610615 Vim checks up to 10 times per second for jobs that
@@ -638,7 +643,7 @@ See |job_setoptions()| and |ch_setoptions()|.
638643"channel": {channel} Use an existing channel instead of creating a new one.
639644 The parts of the channel that get used for the new job
640645 will be disconnected from what they were used before.
641- If the channel was still use by another job this may
646+ If the channel was still used by another job this may
642647 cause I/O errors.
643648 Existing callbacks and other settings remain.
644649
@@ -656,7 +661,7 @@ See |job_setoptions()| and |ch_setoptions()|.
656661"out_io": "null" disconnect stdout (goes to /dev/null)
657662"out_io": "pipe" stdout is connected to the channel (default)
658663"out_io": "file" stdout writes to a file
659- "out_io": "buffer" stdout appends to a buffer (see below)
664+ "out_io": "buffer" stdout appends to a buffer (see below)
660665"out_name": "/path/file" the name of the file or buffer to write to
661666"out_buf": number the number of the buffer to write to
662667"out_modifiable": 0 when writing to a buffer, 'modifiable' will be off
@@ -669,7 +674,7 @@ See |job_setoptions()| and |ch_setoptions()|.
669674"err_io": "null" disconnect stderr (goes to /dev/null)
670675"err_io": "pipe" stderr is connected to the channel (default)
671676"err_io": "file" stderr writes to a file
672- "err_io": "buffer" stderr appends to a buffer (see below)
677+ "err_io": "buffer" stderr appends to a buffer (see below)
673678"err_name": "/path/file" the name of the file or buffer to write to
674679"err_buf": number the number of the buffer to write to
675680"err_modifiable": 0 when writing to a buffer, 'modifiable' will be off
0 commit comments