Friday, May 6, 2016

Understanding job_start()

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. On the other hand, the following works just
fine, i.e., it silently runs lualatex in the background as I want:

call job_start(['lualatex', 'foo.tex'],
\ {"out_io": "file", "out_name": "/dev/null", "err_io": "null"})

Shouldn't this form be equivalent to the previous one? In general, if all I
want is launch a process, but I don't care about its output, is this the right
way?

Tangentially related to the above, it seems to me that the callback is not
called as soon as the job is done, but only after a while, and it's triggered
only if I press some key. Is that normal?

Nicola


--
--
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:

Post a Comment