if (r && nread > 0)
return CW_READY;
- if (r == 0)
+
+ if (channel->ch_named_pipe)
+ {
+ DisconnectNamedPipe((HANDLE)fd);
+ ConnectNamedPipe((HANDLE)fd, NULL);
+ }
+ else if (r == 0)
return CW_ERROR;
/* perhaps write some buffer lines */
if (part == PART_SOCK)
res = sock_write(fd, (char *)buf, len);
else
+ {
res = fd_write(fd, (char *)buf, len);
+#ifdef WIN32
+ if (channel->ch_named_pipe && res < 0)
+ {
+ DisconnectNamedPipe((HANDLE)fd);
+ ConnectNamedPipe((HANDLE)fd, NULL);
+ }
+#endif
+ }
if (res < 0 && (errno == EWOULDBLOCK
#ifdef EAGAIN
|| errno == EAGAIN
func Test_terminal_no_cmd()
" Does not work on Mac.
- " Todo: make this work on Win32 again
- if has('mac') || has('win32')
+ if has('mac')
return
endif
let buf = term_start('NONE', {})