forked from aniani/vim
patch 8.0.1076: term_start() does not take callbacks
Problem: term_start() does not take callbacks. When using two terminals without a job only one is read from. A terminal without a window returns the wrong pty. Solution: Support "callback", "out_cb" and "err_cb". Fix terminal without a window. Fix reading from multiple channels.
This commit is contained in:
@@ -3692,13 +3692,10 @@ channel_send(
|
||||
{
|
||||
res = fd_write(fd, (char *)buf, len);
|
||||
#ifdef WIN32
|
||||
if (channel->ch_named_pipe)
|
||||
if (channel->ch_named_pipe && res < 0)
|
||||
{
|
||||
if (res < 0)
|
||||
{
|
||||
DisconnectNamedPipe((HANDLE)fd);
|
||||
ConnectNamedPipe((HANDLE)fd, NULL);
|
||||
}
|
||||
DisconnectNamedPipe((HANDLE)fd);
|
||||
ConnectNamedPipe((HANDLE)fd, NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -4084,6 +4081,7 @@ channel_select_check(int ret_in, void *rfds_in, void *wfds_in)
|
||||
if (ret > 0 && fd != INVALID_FD && FD_ISSET(fd, rfds))
|
||||
{
|
||||
channel_read(channel, part, "channel_select_check");
|
||||
FD_CLR(fd, rfds);
|
||||
--ret;
|
||||
}
|
||||
}
|
||||
@@ -4093,6 +4091,7 @@ channel_select_check(int ret_in, void *rfds_in, void *wfds_in)
|
||||
&& FD_ISSET(in_part->ch_fd, wfds))
|
||||
{
|
||||
channel_write_input(channel);
|
||||
FD_CLR(in_part->ch_fd, wfds);
|
||||
--ret;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user