aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2016-01-20 11:55:40 +0100
committerBjörn Linse <bjorn.linse@gmail.com>2016-01-20 11:55:40 +0100
commit297075bf47d09437deb82266c61cd830dc8d72eb (patch)
treeb6a2e2f41abb83f0f732ad259cddf7dab66ef741 /runtime
parentee0e214427d7ed2a9fd8ffc85c424cfffc927408 (diff)
parentf6ecd127b9c999b63d33e2da542f32528530698a (diff)
downloadrneovim-297075bf47d09437deb82266c61cd830dc8d72eb.tar.gz
rneovim-297075bf47d09437deb82266c61cd830dc8d72eb.tar.bz2
rneovim-297075bf47d09437deb82266c61cd830dc8d72eb.zip
Merge pull request #3944 from bfredl/detach
job control: add `detach` option and `jobpid` function and teardown PTY processes correctly.
Diffstat (limited to 'runtime')
-rw-r--r--runtime/autoload/provider/clipboard.vim1
-rw-r--r--runtime/doc/eval.txt8
2 files changed, 9 insertions, 0 deletions
diff --git a/runtime/autoload/provider/clipboard.vim b/runtime/autoload/provider/clipboard.vim
index 5d1ce7896d..3728eb9367 100644
--- a/runtime/autoload/provider/clipboard.vim
+++ b/runtime/autoload/provider/clipboard.vim
@@ -83,6 +83,7 @@ function! s:clipboard.set(lines, regtype, reg)
end
let selection.data = [a:lines, a:regtype]
let argv = split(s:copy[a:reg], " ")
+ let selection.detach = s:cache_enabled
let jobid = jobstart(argv, selection)
if jobid <= 0
echohl WarningMsg
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 1f1dc71f28..ce002eed37 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -1894,6 +1894,7 @@ isdirectory( {directory}) Number TRUE if {directory} is a directory
islocked( {expr}) Number TRUE if {expr} is locked
items( {dict}) List key-value pairs in {dict}
jobclose({job}[, {stream}]) Number Closes a job stream(s)
+jobpid({job}) Number Returns pid of a job.
jobresize({job}, {width}, {height})
Number Resize {job}'s pseudo terminal window
jobsend({job}, {data}) Number Writes {data} to {job}'s stdin
@@ -4157,6 +4158,9 @@ jobclose({job}[, {stream}]) {Nvim} *jobclose()*
Close {job}'s {stream}, which can be one "stdin", "stdout" or
"stderr". If {stream} is omitted, all streams are closed.
+jobpid({job}) {Nvim} *jobpid()*
+ Return the pid (process id) of {job}.
+
jobresize({job}, {width}, {height}) {Nvim} *jobresize()*
Resize {job}'s pseudo terminal window to {width} and {height}.
This function will fail if used on jobs started without the
@@ -4194,6 +4198,10 @@ jobstart({cmd}[, {opts}]) {Nvim} *jobstart()*
- width: Width of the terminal screen(only if pty is set)
- height: Height of the terminal screen(only if pty is set)
- TERM: $TERM environment variable(only if pty is set)
+ - detach: Detach the job process from the nvim process. The
+ process won't get killed when nvim exists. If the process
+ dies before nvim exits, on_exit will still be invoked.
+ This option is only allowed for non-pty jobs.
Either funcrefs or function names can be passed as event
handlers. The {opts} object is also used as the "self"
argument for the callback, so the caller may pass arbitrary