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?

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.

Cheers,
-- 
James
GPG Key: 4096R/331BA3DB 2011-12-05 James McCoy <james...@jamessan.com>

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui