On 26 April 2016, Bram Moolenaar <[email protected]> wrote:
>
> James McCoy wrote:
>
> > On Mon, Apr 25, 2016 at 11:06:43PM +0200, Bram Moolenaar wrote:
> > >
> > > Andrew Stewart wrote:
> > >
> > > > This handler gets called just about immediately, as expected, but
> > > > a:message is always 'DETACH', not the diff output. And then a few
> > > > seconds later the exit handler echoes its E906 error.
> > >
> > > This works. But the script should use "out_cb":
> > >
> > > func! OutHandler(channel, msg)
> > > echomsg a:msg
> > > endfunc
> > > let cmd = 'diff -u /tmp/a /tmp/b'
> > > let job = job_start(cmd, {'out_cb': 'OutHandler'})
> > >
> > > The echo statements overwrite each other, "DETACH" is the last one. Use
> > > ":messages" to see what happened before this.
> >
> > Why is Vim injecting "DETACH" into the output? The netbeans code uses
> > is because that's part of the established protocol, but why is that
> > being imposed on every other user of channels?
>
> Yeah, I was also wondering if we need it.
Some way to test for EOF would be more useful, IMO. Not quite the
same thing as a close callback.
/lcd
> At least when there is a close callback it doesn't make sense.
>
> I would think that normally the job will send some terminator.
> Otherwise, one can add a close callback if one needs to know the
> channel is done reading. Would there be any reason to add DETACH?
>
> Previously the close callback didn't work properly. I fixed that now.
>
> > Also, the help implies that this is only done for channels
> > representing a socket, not ones that are used for a simple
> > job_start() with a process:
> >
> > On read error or ch_close(), when using a socket with RAW or NL
> > mode, the string "DETACH\n" is sent, if still possible. The
> > channel will then be inactive.
>
> The documentation is wrong.
--
--
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.