mirror of
https://github.com/tmux/tmux.git
synced 2026-03-06 07:45:35 +00:00
Add pane_pipe_pid with pipe fd and call setpgid to make it easier to kill.
This commit is contained in:
14
format.c
14
format.c
@@ -2225,6 +2225,17 @@ format_cb_pane_pipe(struct format_tree *ft)
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/* Callback for pane_pipe_pid. */
|
||||
static void *
|
||||
format_cb_pane_pipe_pid(struct format_tree *ft)
|
||||
{
|
||||
char *value = NULL;
|
||||
|
||||
if (ft->wp != NULL && ft->wp->pipe_fd != -1)
|
||||
xasprintf(&value, "%ld", (long)ft->wp->pipe_pid);
|
||||
return (value);
|
||||
}
|
||||
|
||||
/* Callback for pane_right. */
|
||||
static void *
|
||||
format_cb_pane_right(struct format_tree *ft)
|
||||
@@ -3311,6 +3322,9 @@ static const struct format_table_entry format_table[] = {
|
||||
{ "pane_pipe", FORMAT_TABLE_STRING,
|
||||
format_cb_pane_pipe
|
||||
},
|
||||
{ "pane_pipe_pid", FORMAT_TABLE_STRING,
|
||||
format_cb_pane_pipe_pid
|
||||
},
|
||||
{ "pane_right", FORMAT_TABLE_STRING,
|
||||
format_cb_pane_right
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user