summaryrefslogtreecommitdiffstats
path: root/cmd-respawn-pane.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2011-11-15 23:19:51 +0000
committerNicholas Marriott <nicm@openbsd.org>2011-11-15 23:19:51 +0000
commit57df44291634e1083fccf29ecccc8b1793647e50 (patch)
treec93759746d1f177de3bb0cca0909c6aa984bb81b /cmd-respawn-pane.c
parent9f738dd2fe01b5b70c07280450eed32614c561c2 (diff)
Make window_pane_index work the same as window_index, from Ben Boeckel.
Diffstat (limited to 'cmd-respawn-pane.c')
-rw-r--r--cmd-respawn-pane.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/cmd-respawn-pane.c b/cmd-respawn-pane.c
index 7e272a80..d4d67d54 100644
--- a/cmd-respawn-pane.c
+++ b/cmd-respawn-pane.c
@@ -49,15 +49,18 @@ cmd_respawn_pane_exec(struct cmd *self, struct cmd_ctx *ctx)
struct session *s;
struct environ env;
const char *cmd;
- char *cause;
+ char *cause;
+ u_int idx;
if ((wl = cmd_find_pane(ctx, args_get(args, 't'), &s, &wp)) == NULL)
return (-1);
w = wl->window;
if (!args_has(self->args, 'k') && wp->fd != -1) {
+ if (window_pane_index(wp, &idx) != 0)
+ fatalx("index not found");
ctx->error(ctx, "pane still active: %s:%u.%u",
- s->name, wl->idx, window_pane_index(w, wp));
+ s->name, wl->idx, idx);
return (-1);
}