mirror of
https://github.com/tmux/tmux.git
synced 2025-09-02 05:21:10 +00:00
Merge branch 'obsd-master'
This commit is contained in:
14
window.c
14
window.c
@ -390,13 +390,17 @@ window_destroy(struct window *w)
|
||||
int
|
||||
window_pane_destroy_ready(struct window_pane *wp)
|
||||
{
|
||||
if (wp->pipe_fd != -1 && EVBUFFER_LENGTH(wp->pipe_event->output) != 0)
|
||||
return (0);
|
||||
int n;
|
||||
|
||||
if (wp->pipe_fd != -1) {
|
||||
if (EVBUFFER_LENGTH(wp->pipe_event->output) != 0)
|
||||
return (0);
|
||||
if (ioctl(wp->fd, FIONREAD, &n) != -1 && n > 0)
|
||||
return (0);
|
||||
}
|
||||
|
||||
if (~wp->flags & PANE_EXITED)
|
||||
return (0);
|
||||
if (~wp->flags & PANE_ERROR)
|
||||
return (0);
|
||||
return (1);
|
||||
}
|
||||
|
||||
@ -1028,7 +1032,7 @@ window_pane_error_callback(__unused struct bufferevent *bufev,
|
||||
struct window_pane *wp = data;
|
||||
|
||||
log_debug("%%%u error", wp->id);
|
||||
wp->flags |= PANE_ERROR;
|
||||
wp->flags |= PANE_EXITED;
|
||||
|
||||
if (window_pane_destroy_ready(wp))
|
||||
server_destroy_pane(wp, 1);
|
||||
|
Reference in New Issue
Block a user