=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/format.c,v retrieving revision 1.146 retrieving revision 1.147 diff -c -r1.146 -r1.147 *** src/usr.bin/tmux/format.c 2017/08/09 11:43:45 1.146 --- src/usr.bin/tmux/format.c 2017/10/12 11:32:27 1.147 *************** *** 1,4 **** ! /* $OpenBSD: format.c,v 1.146 2017/08/09 11:43:45 nicm Exp $ */ /* * Copyright (c) 2011 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: format.c,v 1.147 2017/10/12 11:32:27 nicm Exp $ */ /* * Copyright (c) 2011 Nicholas Marriott *************** *** 1376,1383 **** format_defaults_pane(struct format_tree *ft, struct window_pane *wp) { struct grid *gd = wp->base.grid; u_int idx; - int status; if (ft->w == NULL) ft->w = wp->window; --- 1376,1383 ---- format_defaults_pane(struct format_tree *ft, struct window_pane *wp) { struct grid *gd = wp->base.grid; + int status = wp->status; u_int idx; if (ft->w == NULL) ft->w = wp->window; *************** *** 1399,1406 **** format_add(ft, "pane_input_off", "%d", !!(wp->flags & PANE_INPUTOFF)); format_add(ft, "pane_pipe", "%d", wp->pipe_fd != -1); ! 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); --- 1399,1405 ---- format_add(ft, "pane_input_off", "%d", !!(wp->flags & PANE_INPUTOFF)); format_add(ft, "pane_pipe", "%d", wp->pipe_fd != -1); ! if ((wp->flags & PANE_STATUSREADY) && WIFEXITED(status)) format_add(ft, "pane_dead_status", "%d", WEXITSTATUS(status)); format_add(ft, "pane_dead", "%d", wp->fd == -1); *************** *** 1411,1418 **** format_add(ft, "pane_bottom", "%u", wp->yoff + wp->sy - 1); format_add(ft, "pane_at_left", "%d", wp->xoff == 0); format_add(ft, "pane_at_top", "%d", wp->yoff == 0); ! format_add(ft, "pane_at_right", "%d", wp->xoff + wp->sx == wp->window->sx); ! format_add(ft, "pane_at_bottom", "%d", wp->yoff + wp->sy == wp->window->sy); } format_add(ft, "pane_in_mode", "%d", wp->screen != &wp->base); --- 1410,1419 ---- format_add(ft, "pane_bottom", "%u", wp->yoff + wp->sy - 1); format_add(ft, "pane_at_left", "%d", wp->xoff == 0); format_add(ft, "pane_at_top", "%d", wp->yoff == 0); ! format_add(ft, "pane_at_right", "%d", ! wp->xoff + wp->sx == wp->window->sx); ! format_add(ft, "pane_at_bottom", "%d", ! wp->yoff + wp->sy == wp->window->sy); } format_add(ft, "pane_in_mode", "%d", wp->screen != &wp->base);