version 1.12, 2010/05/04 17:28:16 |
version 1.13, 2010/06/05 16:34:30 |
|
|
#include <fcntl.h> |
#include <fcntl.h> |
#include <paths.h> |
#include <paths.h> |
#include <string.h> |
#include <string.h> |
|
#include <time.h> |
#include <unistd.h> |
#include <unistd.h> |
|
|
#include "tmux.h" |
#include "tmux.h" |
|
|
cmd_pipe_pane_exec(struct cmd *self, struct cmd_ctx *ctx) |
cmd_pipe_pane_exec(struct cmd *self, struct cmd_ctx *ctx) |
{ |
{ |
struct cmd_target_data *data = self->data; |
struct cmd_target_data *data = self->data; |
|
struct client *c; |
struct window_pane *wp; |
struct window_pane *wp; |
|
char *command; |
int old_fd, pipe_fd[2], null_fd, mode; |
int old_fd, pipe_fd[2], null_fd, mode; |
|
|
|
if ((c = cmd_find_client(ctx, data->target)) == NULL) |
|
return (-1); |
|
|
if (cmd_find_pane(ctx, data->target, NULL, &wp) == NULL) |
if (cmd_find_pane(ctx, data->target, NULL, &wp) == NULL) |
return (-1); |
return (-1); |
|
|
|
|
if (null_fd != STDOUT_FILENO && null_fd != STDERR_FILENO) |
if (null_fd != STDOUT_FILENO && null_fd != STDERR_FILENO) |
close(null_fd); |
close(null_fd); |
|
|
execl(_PATH_BSHELL, "sh", "-c", data->arg, (char *) NULL); |
command = status_replace(c, NULL, data->arg, time(NULL), 0); |
|
execl(_PATH_BSHELL, "sh", "-c", command, (char *) NULL); |
_exit(1); |
_exit(1); |
default: |
default: |
/* Parent process. */ |
/* Parent process. */ |