version 1.54, 2020/04/13 20:51:57 |
version 1.55, 2020/05/21 07:24:13 |
|
|
static enum cmd_retval |
static enum cmd_retval |
cmd_pipe_pane_exec(struct cmd *self, struct cmdq_item *item) |
cmd_pipe_pane_exec(struct cmd *self, struct cmdq_item *item) |
{ |
{ |
struct args *args = cmd_get_args(self); |
struct args *args = cmd_get_args(self); |
struct cmd_find_state *target = cmdq_get_target(item); |
struct cmd_find_state *target = cmdq_get_target(item); |
struct client *tc = cmdq_get_target_client(item); |
struct client *tc = cmdq_get_target_client(item); |
struct window_pane *wp = target->wp; |
struct window_pane *wp = target->wp; |
struct session *s = target->s; |
struct session *s = target->s; |
struct winlink *wl = target->wl; |
struct winlink *wl = target->wl; |
char *cmd; |
struct window_pane_offset *wpo = &wp->pipe_offset; |
int old_fd, pipe_fd[2], null_fd, in, out; |
char *cmd; |
struct format_tree *ft; |
int old_fd, pipe_fd[2], null_fd, in, out; |
sigset_t set, oldset; |
struct format_tree *ft; |
|
sigset_t set, oldset; |
|
|
/* Destroy the old pipe. */ |
/* Destroy the old pipe. */ |
old_fd = wp->pipe_fd; |
old_fd = wp->pipe_fd; |
|
|
close(pipe_fd[1]); |
close(pipe_fd[1]); |
|
|
wp->pipe_fd = pipe_fd[0]; |
wp->pipe_fd = pipe_fd[0]; |
if (wp->fd != -1) |
memcpy(wpo, &wp->offset, sizeof *wpo); |
wp->pipe_off = EVBUFFER_LENGTH(wp->event->input); |
|
else |
|
wp->pipe_off = 0; |
|
|
|
setblocking(wp->pipe_fd, 0); |
setblocking(wp->pipe_fd, 0); |
wp->pipe_event = bufferevent_new(wp->pipe_fd, |
wp->pipe_event = bufferevent_new(wp->pipe_fd, |