Friday, May 6, 2016

Re: Understanding job_start()

Nicola wrote:

> On 2016-05-06 17:19:58 +0000, Nicola said:
>
> > Some time ago I had defined a thin wrapper around job_start() to run a LaTeX
> > job asynchronously. Recently, it has stopped working. For some reason, with Vim
> > 7.4.1817, when I give the following command:
> >
> > call job_start(['lualatex', 'foo.tex'])
> >
> > the job is not started any longer (or, if it is, it dies immediately).
> > Suspecting some problem with I/O redirection, I have tried to set "out_io" and
> > "err_io". If I use:
> >
> > call job_start(['lualatex', 'foo.tex'],
> > \ {"out_io": "null", "err_io": "null"})
> >
> > the job is started, but the screen gets garbled with the output from lualatex,
> > and I need to :redraw! the screen.
>
> To be clear, the above also happens if I close "in_io", too, as
> explained in the
> manual. And I've tried to add redirection in the command, too:
>
> call job_start(['lualatex', 'foo.tex', '>/dev/null', '2>&1'],
> \ {"in_io": "null", "out_io": "null", "err_io": "null"})
>
> This still fills the screen with the output from lualatex.

What system is this on? What patch level?

Vim should redirect the outputs, but this may only work on Unix.
It appears on Windows it just skips creatting the pipes, but doesn't
connected them to /dev/null (if such a thing exists on Windows).

You mention a callback, but your code doesn't show any callback.
If you mean the exit_cb for the job, that is indeed called after some
delay. You can speed it up by calling job_status(), e.g. in the channel
close callback.

--
Corn oil comes from corn and olive oil comes from olives, so where
does baby oil come from?

/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: