aboutsummaryrefslogtreecommitdiff
path: root/cmd-break-pane.c
diff options
context:
space:
mode:
authorThomas Adam <thomas.adam@smoothwall.net>2013-03-25 14:59:29 +0000
committerThomas Adam <thomas.adam@smoothwall.net>2013-03-25 14:59:29 +0000
commitf90eb43fcb12720711ea01b110c5b474111e6600 (patch)
tree43b2e85bcf1626e3810ade10578ac18399931772 /cmd-break-pane.c
parent418ba99078a2712ece398e17a5a9bc1f6600126b (diff)
parent58bb6f8c5650d496fb3b872766c0278aa024631d (diff)
downloadrtmux-f90eb43fcb12720711ea01b110c5b474111e6600.tar.gz
rtmux-f90eb43fcb12720711ea01b110c5b474111e6600.tar.bz2
rtmux-f90eb43fcb12720711ea01b110c5b474111e6600.zip
Merge branch 'obsd-master'
Diffstat (limited to 'cmd-break-pane.c')
-rw-r--r--cmd-break-pane.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/cmd-break-pane.c b/cmd-break-pane.c
index 637105ab..8ed9a1a6 100644
--- a/cmd-break-pane.c
+++ b/cmd-break-pane.c
@@ -26,7 +26,7 @@
* Break pane off into a window.
*/
-enum cmd_retval cmd_break_pane_exec(struct cmd *, struct cmd_ctx *);
+enum cmd_retval cmd_break_pane_exec(struct cmd *, struct cmd_q *);
const struct cmd_entry cmd_break_pane_entry = {
"break-pane", "breakp",
@@ -39,7 +39,7 @@ const struct cmd_entry cmd_break_pane_entry = {
};
enum cmd_retval
-cmd_break_pane_exec(struct cmd *self, struct cmd_ctx *ctx)
+cmd_break_pane_exec(struct cmd *self, struct cmd_q *cmdq)
{
struct args *args = self->args;
struct winlink *wl;
@@ -54,15 +54,17 @@ cmd_break_pane_exec(struct cmd *self, struct cmd_ctx *ctx)
const char *template;
char *cp;
- if ((wl = cmd_find_pane(ctx, args_get(args, 't'), &s, &wp)) == NULL)
+ if ((wl = cmd_find_pane(cmdq, args_get(args, 't'), &s, &wp)) == NULL)
return (CMD_RETURN_ERROR);
if (window_count_panes(wl->window) == 1) {
- ctx->error(ctx, "can't break with only one pane");
+ cmdq_error(cmdq, "can't break with only one pane");
return (CMD_RETURN_ERROR);
}
w = wl->window;
+ server_unzoom_window(w);
+
TAILQ_REMOVE(&w->panes, wp, entry);
if (wp == w->active) {
w->active = w->last;
@@ -82,7 +84,7 @@ cmd_break_pane_exec(struct cmd *self, struct cmd_ctx *ctx)
name = default_window_name(w);
window_set_name(w, name);
free(name);
- layout_init(w);
+ layout_init(w, wp);
base_idx = options_get_number(&s->options, "base-index");
wl = session_attach(s, w, -1 - base_idx, &cause); /* can't fail */
@@ -93,19 +95,18 @@ cmd_break_pane_exec(struct cmd *self, struct cmd_ctx *ctx)
server_status_session_group(s);
if (args_has(args, 'P')) {
-
if ((template = args_get(args, 'F')) == NULL)
template = BREAK_PANE_TEMPLATE;
ft = format_create();
- if ((c = cmd_find_client(ctx, NULL)) != NULL)
+ if ((c = cmd_find_client(cmdq, NULL, 1)) != NULL)
format_client(ft, c);
format_session(ft, s);
format_winlink(ft, s, wl);
format_window_pane(ft, wp);
cp = format_expand(ft, template);
- ctx->print(ctx, "%s", cp);
+ cmdq_print(cmdq, "%s", cp);
free(cp);
format_free(ft);