No but it isn't hard to add, try this. Obviously it'll only work with remain-on-exit.
diff --git a/format.c b/format.c index ecfda1b..3670bff 100644 --- a/format.c +++ b/format.c @@ -17,6 +17,7 @@ */ #include <sys/types.h> +#include <sys/wait.h> #include <ctype.h> #include <errno.h> @@ -551,6 +552,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->fd == -1 && WIFEXITED(wp->status)) { + format_add(ft, "pane_dead_status", "%d", + WEXITSTATUS(wp->status)); + } format_add(ft, "pane_in_mode", "%d", wp->screen != &wp->base); format_add(ft, "pane_synchronized", "%d", diff --git a/server.c b/server.c index d3ac0f8..88feb57 100644 --- a/server.c +++ b/server.c @@ -433,6 +433,7 @@ server_child_exited(pid_t pid, int status) continue; TAILQ_FOREACH(wp, &w->panes, entry) { if (wp->pid == pid) { + wp->status = status; server_destroy_pane(wp); break; } diff --git a/tmux.1 b/tmux.1 index 30447ed..9a4c472 100644 --- a/tmux.1 +++ b/tmux.1 @@ -3082,6 +3082,7 @@ The following variables are available, where appropriate: .It Li "pane_current_command" Ta "" Ta "Current command if available" .It Li "pane_current_path" Ta "" Ta "Current path if available" .It Li "pane_dead" Ta "" Ta "1 if pane is dead" +.It Li "pane_dead_status" Ta "" Ta "Exit status of process in dead pane" .It Li "pane_height" Ta "" Ta "Height of pane" .It Li "pane_id" Ta "#D" Ta "Unique pane ID" .It Li "pane_in_mode" Ta "" Ta "If pane is in a mode" On Sun, Jun 08, 2014 at 05:50:57PM -0700, Jesse Molina wrote: > > If I want to get the process ID that is running in the active > pane/window on a session, I can do this: > > tmux list-panes -t $SESSION -F '#{pane_pid}' > > But if the pane is dead because the process quit, is there a way to get > the exit code that the process quit with? Specifically, I need to do > this from outside of tmux, like the command above. > > > > ------------------------------------------------------------------------------ > HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions > Find What Matters Most in Your Big Data with HPCC Systems > Open Source. Fast. Scalable. Simple. Ideal for Dirty Data. > Leverages Graph Analysis for Fast Processing & Easy Data Exploration > http://www.hpccsystems.com > _______________________________________________ > tmux-users mailing list > tmux-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/tmux-users ------------------------------------------------------------------------------ HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions Find What Matters Most in Your Big Data with HPCC Systems Open Source. Fast. Scalable. Simple. Ideal for Dirty Data. Leverages Graph Analysis for Fast Processing & Easy Data Exploration http://www.hpccsystems.com _______________________________________________ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users