From d0d5d17b69b635096bc4c0f88c4a9b10af04cf01 Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Mon, 4 Jan 2016 17:15:25 +0100 Subject: job control: add 'detach' option to jobstart --- runtime/doc/eval.txt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'runtime') diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 1f1dc71f28..9207f1a85c 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -4194,6 +4194,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 -- cgit From 49f04179888944943f0266cd77810e467f9d68ef Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Mon, 4 Jan 2016 17:15:45 +0100 Subject: clipboard: Detach clipboard helper, so contents is kept after nvim exit --- runtime/autoload/provider/clipboard.vim | 1 + 1 file changed, 1 insertion(+) (limited to 'runtime') 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 -- cgit From f338ea783591cdf4fcbaf948cd675374ba1fb3b9 Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Fri, 8 Jan 2016 13:51:31 +0100 Subject: job control: implement jobpid() to get PID of job --- runtime/doc/eval.txt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'runtime') diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 9207f1a85c..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 -- cgit