Do not allow pipe-pane on dead panes, from Anindya Mukherjee, GitHub

issue 3174.
pull/3201/head
nicm 2022-05-30 13:03:46 +00:00
parent 2b60ff588e
commit af1496b300
1 changed files with 6 additions and 0 deletions

View File

@ -68,6 +68,12 @@ cmd_pipe_pane_exec(struct cmd *self, struct cmdq_item *item)
struct format_tree *ft;
sigset_t set, oldset;
/* Do nothing if pane is dead. */
if (wp->fd == -1 || (wp->flags & PANE_EXITED)) {
cmdq_error(item, "target pane has exited");
return (CMD_RETURN_ERROR);
}
/* Destroy the old pipe. */
old_fd = wp->pipe_fd;
if (wp->pipe_fd != -1) {