diff options
Diffstat (limited to 'format.c')
-rw-r--r-- | format.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -18,6 +18,7 @@ #include <sys/types.h> #include <sys/param.h> +#include <sys/wait.h> #include <ctype.h> #include <errno.h> @@ -582,6 +583,7 @@ format_window_pane(struct format_tree *ft, struct window_pane *wp) unsigned long long size; u_int i, idx; char *cmd, *cwd; + int status; if (ft->w == NULL) ft->w = wp->window; @@ -605,9 +607,13 @@ format_window_pane(struct format_tree *ft, struct window_pane *wp) format_add(ft, "pane_title", "%s", wp->base.title); 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); format_add(ft, "pane_input_off", "%d", !!(wp->flags & PANE_INPUTOFF)); + status = wp->status; + if (wp->fd == -1 && WIFEXITED(status)) + format_add(ft, "pane_dead_status", "%d", WEXITSTATUS(status)); + format_add(ft, "pane_dead", "%d", wp->fd == -1); + if (window_pane_visible(wp)) { format_add(ft, "pane_left", "%u", wp->xoff); format_add(ft, "pane_top", "%u", wp->yoff); |