diff options
author | Thomas Adam <thomas@xteddy.org> | 2020-05-21 08:55:31 +0100 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2020-05-21 08:55:31 +0100 |
commit | 40126ee96c0b9e66ad90ed94767287de13d2a79e (patch) | |
tree | 904792b0705a56bb72edfb7137d18baf89ffbab3 /cmd-pipe-pane.c | |
parent | 98a18d064aaf46e0b97a375b8c5b2b9ff15cf3df (diff) | |
parent | 31e3f2d530090793815d145a16a1ce3b469c4266 (diff) | |
download | rtmux-40126ee96c0b9e66ad90ed94767287de13d2a79e.tar.gz rtmux-40126ee96c0b9e66ad90ed94767287de13d2a79e.tar.bz2 rtmux-40126ee96c0b9e66ad90ed94767287de13d2a79e.zip |
Merge branch 'obsd-master'
Diffstat (limited to 'cmd-pipe-pane.c')
-rw-r--r-- | cmd-pipe-pane.c | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/cmd-pipe-pane.c b/cmd-pipe-pane.c index b64229d8..f3fe6344 100644 --- a/cmd-pipe-pane.c +++ b/cmd-pipe-pane.c @@ -55,16 +55,17 @@ const struct cmd_entry cmd_pipe_pane_entry = { 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; @@ -158,10 +159,7 @@ cmd_pipe_pane_exec(struct cmd *self, struct cmdq_item *item) 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, |