mirror of
https://github.com/tmux/tmux.git
synced 2025-11-05 01:56:07 +00:00
Pass return code from _exec; allow command sequences to work from the command line.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* $Id: cmd-select-pane.c,v 1.1 2009-01-14 19:56:55 nicm Exp $ */
|
||||
/* $Id: cmd-select-pane.c,v 1.2 2009-01-19 18:23:40 nicm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||
@@ -24,7 +24,7 @@
|
||||
* Select pane.
|
||||
*/
|
||||
|
||||
void cmd_select_pane_exec(struct cmd *, struct cmd_ctx *);
|
||||
int cmd_select_pane_exec(struct cmd *, struct cmd_ctx *);
|
||||
|
||||
const struct cmd_entry cmd_select_pane_entry = {
|
||||
"select-pane", "selectp",
|
||||
@@ -39,7 +39,7 @@ const struct cmd_entry cmd_select_pane_entry = {
|
||||
cmd_pane_print
|
||||
};
|
||||
|
||||
void
|
||||
int
|
||||
cmd_select_pane_exec(struct cmd *self, struct cmd_ctx *ctx)
|
||||
{
|
||||
struct cmd_pane_data *data = self->data;
|
||||
@@ -47,23 +47,22 @@ cmd_select_pane_exec(struct cmd *self, struct cmd_ctx *ctx)
|
||||
struct window_pane *wp;
|
||||
|
||||
if ((wl = cmd_find_window(ctx, data->target, NULL)) == NULL)
|
||||
return;
|
||||
return (-1);
|
||||
if (data->pane == -1)
|
||||
wp = wl->window->active;
|
||||
else {
|
||||
wp = window_pane_at_index(wl->window, data->pane);
|
||||
if (wp == NULL) {
|
||||
ctx->error(ctx, "no pane: %d", data->pane);
|
||||
return;
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
|
||||
if (wp->flags & PANE_HIDDEN) {
|
||||
ctx->error(ctx, "pane %d is hidden", data->pane);
|
||||
return;
|
||||
return (-1);
|
||||
}
|
||||
window_set_active_pane(wl->window, wp);
|
||||
|
||||
if (ctx->cmdclient != NULL)
|
||||
server_write_client(ctx->cmdclient, MSG_EXIT, NULL, 0);
|
||||
return (0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user