From 49ef0b4af31ed67a38d2e70e6ac60d48b0730519 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Sun, 2 Oct 2011 06:55:48 +0000 Subject: [PATCH] Add a few more formats for panes (tty, pid, start cmd/cwd). --- format.c | 6 ++++++ tmux.1 | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/format.c b/format.c index 0c1be744..21f359ab 100644 --- a/format.c +++ b/format.c @@ -343,4 +343,10 @@ format_window_pane(struct format_tree *ft, struct window_pane *wp) format_add(ft, "pane_id", "%%%u", wp->id); format_add(ft, "pane_active", "%d", wp == wp->window->active); format_add(ft, "pane_dead", "%d", wp->fd == -1); + if (wp->cmd != NULL) + format_add(ft, "pane_start_command", "%s", wp->cmd); + if (wp->cwd != NULL) + format_add(ft, "pane_start_path", "%s", wp->cwd); + format_add(ft, "pane_pid", "%ld", (long) wp->pid); + format_add(ft, "pane_tty", "%s", wp->tty); } diff --git a/tmux.1 b/tmux.1 index 9dc8bb04..e554254e 100644 --- a/tmux.1 +++ b/tmux.1 @@ -2603,7 +2603,11 @@ The following variables are available, where appropriate: .It Li "pane_dead" Ta "1 if pane is dead" .It Li "pane_height" Ta "Height of pane" .It Li "pane_id" Ta "Unique pane id" +.It Li "pane_pid" Ta "PID of first process in pane" +.It Li "pane_start_command" Ta "Command pane started with" +.It Li "pane_start_path" Ta "Path pane started with" .It Li "pane_title" Ta "Title of pane" +.It Li "pane_tty" Ta "Pseudo terminal of pane" .It Li "pane_width" Ta "Width of pane" .It Li "session_attached" Ta "1 if session attached" .It Li "session_created" Ta "Integer time session created"