=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/cmd-pipe-pane.c,v retrieving revision 1.54 retrieving revision 1.55 diff -u -r1.54 -r1.55 --- src/usr.bin/tmux/cmd-pipe-pane.c 2020/04/13 20:51:57 1.54 +++ src/usr.bin/tmux/cmd-pipe-pane.c 2020/05/21 07:24:13 1.55 @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-pipe-pane.c,v 1.54 2020/04/13 20:51:57 nicm Exp $ */ +/* $OpenBSD: cmd-pipe-pane.c,v 1.55 2020/05/21 07:24:13 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -56,16 +56,17 @@ static enum cmd_retval cmd_pipe_pane_exec(struct cmd *self, struct cmdq_item *item) { - struct args *args = cmd_get_args(self); - struct cmd_find_state *target = cmdq_get_target(item); - struct client *tc = cmdq_get_target_client(item); - struct window_pane *wp = target->wp; - struct session *s = target->s; - struct winlink *wl = target->wl; - char *cmd; - int old_fd, pipe_fd[2], null_fd, in, out; - struct format_tree *ft; - sigset_t set, oldset; + struct args *args = cmd_get_args(self); + struct cmd_find_state *target = cmdq_get_target(item); + struct client *tc = cmdq_get_target_client(item); + struct window_pane *wp = target->wp; + struct session *s = target->s; + struct winlink *wl = target->wl; + struct window_pane_offset *wpo = &wp->pipe_offset; + char *cmd; + int old_fd, pipe_fd[2], null_fd, in, out; + struct format_tree *ft; + sigset_t set, oldset; /* Destroy the old pipe. */ old_fd = wp->pipe_fd; @@ -159,10 +160,7 @@ close(pipe_fd[1]); wp->pipe_fd = pipe_fd[0]; - if (wp->fd != -1) - wp->pipe_off = EVBUFFER_LENGTH(wp->event->input); - else - wp->pipe_off = 0; + memcpy(wpo, &wp->offset, sizeof *wpo); setblocking(wp->pipe_fd, 0); wp->pipe_event = bufferevent_new(wp->pipe_fd,