On Sunday, September 4, 2016 at 11:19:35 PM UTC+9, Bram Moolenaar wrote:
> Yasuhiro Matsumoto wrote:
>
> > When the job exit immediately, channel->ch_to_be_closed will be TRUE
> > before channel_read even though the output buffer is filled enough to
> > read. For example, following command doesn't output result of the job.
> >
> > ---------
> > function! Disp(ch, msg)
> > echom a:msg
> > endfunction
> >
> > function! PerlCheck()
> > let s:job = job_start("perl -cw ".expand("%"), { "callback" :
> > function("Disp") })
> > endfunction
> > ---------
>
> I cannot reproduce the problem. Does this only happen on MS-Windows
> perhaps?
>
> > Below is a patch to fix this. This change doesn't break any tests.
> >
> > https://gist.github.com/130f41a825ec72ccddb55b189d11558f
>
> It looks like the change in channel_wait() is a no-op.
> So the essential thing is to ignore ch_to_be_closed in channel_read().
> Can you explain how we would get there with ch_to_be_closed set while
> there is still something to read? It should only happen after reading
> failed.
>
> Hmm, is it because PeekNamedPipe() returns zero but there is still
> something to read?
Yes, Right. stdout/stdin/stderr is buffer(s). So can't ignore output even
though the jo was exited.
--
--
You received this message from the "vim_dev" 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_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.