Merge branch 'obsd-master'

This commit is contained in:
Thomas Adam
2026-06-13 19:15:06 +01:00
2 changed files with 54 additions and 10 deletions

View File

@@ -49,10 +49,10 @@ const struct cmd_entry cmd_move_pane_entry = {
.name = "move-pane", .name = "move-pane",
.alias = "movep", .alias = "movep",
.args = { "D::L::P:R::U::X:Y:bdfhvp:l:s:t:", 0, 0, NULL }, .args = { "bdfhvl:L::P:R::s:t:U::X:Y:z:", 0, 0, NULL },
.usage = "[-bdfhv] [-D lines] [-L columns] [-P position] " .usage = "[-bdfhv] [-D lines] [-l size] [-L columns] [-P position] "
"[-R columns] [-U lines] [-X x-position] " "[-R columns] " CMD_SRCDST_PANE_USAGE " [-U lines] "
"[-Y y-position] [-l size] " CMD_SRCDST_PANE_USAGE, "[-X x-position] [-Y y-position] [-z z-index]",
.source = { 's', CMD_FIND_PANE, CMD_FIND_DEFAULT_MARKED }, .source = { 's', CMD_FIND_PANE, CMD_FIND_DEFAULT_MARKED },
.target = { 't', CMD_FIND_PANE, 0 }, .target = { 't', CMD_FIND_PANE, 0 },
@@ -177,8 +177,8 @@ cmd_join_pane_place(struct cmdq_item *item, struct winlink *wl,
lc->xoff = xoff; lc->xoff = xoff;
lc->yoff = yoff; lc->yoff = yoff;
layout_fix_panes(w, NULL); layout_fix_panes(w, NULL);
notify_window("window-layout-changed", w);
} }
notify_window("window-layout-changed", w);
server_redraw_window(w); server_redraw_window(w);
return (CMD_RETURN_NORMAL); return (CMD_RETURN_NORMAL);
@@ -250,6 +250,42 @@ cmd_join_pane_move(struct cmdq_item *item, struct args *args,
return (CMD_RETURN_NORMAL); return (CMD_RETURN_NORMAL);
} }
static enum cmd_retval
cmd_join_pane_zindex(struct cmdq_item *item, struct winlink *wl,
struct window_pane *wp, const char *s)
{
struct window *w = wl->window;
struct window_pane *owp;
const char *errstr;
u_int n, z;
z = strtonum(s, 0, UINT_MAX, &errstr);
if (errstr != NULL) {
cmdq_error(item, "z-index %s", errstr);
return (CMD_RETURN_ERROR);
}
TAILQ_REMOVE(&w->z_index, wp, zentry);
n = 0;
TAILQ_FOREACH(owp, &w->z_index, zentry) {
if (!window_pane_is_floating(owp))
break;
if (n >= z)
break;
n++;
}
if (owp != NULL)
TAILQ_INSERT_BEFORE(owp, wp, zentry);
else
TAILQ_INSERT_TAIL(&w->z_index, wp, zentry);
notify_window("window-layout-changed", w);
server_redraw_window(w);
return (CMD_RETURN_NORMAL);
}
static enum cmd_retval static enum cmd_retval
cmd_join_pane_exec(struct cmd *self, struct cmdq_item *item) cmd_join_pane_exec(struct cmd *self, struct cmdq_item *item)
{ {
@@ -280,6 +316,8 @@ cmd_join_pane_exec(struct cmd *self, struct cmdq_item *item)
} }
if ((s = args_get(args, 'P')) != NULL) if ((s = args_get(args, 'P')) != NULL)
return (cmd_join_pane_place(item, dst_wl, dst_wp, s)); return (cmd_join_pane_place(item, dst_wl, dst_wp, s));
if ((s = args_get(args, 'z')) != NULL)
return (cmd_join_pane_zindex(item, dst_wl, dst_wp, s));
if (args_has(args, 'X') || if (args_has(args, 'X') ||
args_has(args, 'Y') || args_has(args, 'Y') ||
args_has(args, 'U') || args_has(args, 'U') ||

16
tmux.1
View File

@@ -3307,15 +3307,16 @@ reverses the sort order.
.It Xo Ic move\-pane .It Xo Ic move\-pane
.Op Fl bdfhv .Op Fl bdfhv
.Op Fl D Op Ar lines .Op Fl D Op Ar lines
.Op Fl l Ar size
.Op Fl L Op Ar columns .Op Fl L Op Ar columns
.Op Fl P Ar position .Op Fl P Ar position
.Op Fl R Op Ar columns .Op Fl R Op Ar columns
.Op Fl s Ar src\-pane
.Op Fl t Ar dst\-pane
.Op Fl U Op Ar lines .Op Fl U Op Ar lines
.Op Fl X Ar x\-position .Op Fl X Ar x\-position
.Op Fl Y Ar y\-position .Op Fl Y Ar y\-position
.Op Fl l Ar size .Op Fl z Ar z\-index
.Op Fl s Ar src\-pane
.Op Fl t Ar dst\-pane
.Xc .Xc
.D1 Pq alias: Ic movep .D1 Pq alias: Ic movep
Does the same as Does the same as
@@ -3326,9 +3327,10 @@ except if given
.Fl P , .Fl P ,
.Fl R , .Fl R ,
.Fl U , .Fl U ,
.Fl X .Fl X ,
or
.Fl Y .Fl Y
or
.Fl z
in which case move the target floating pane. in which case move the target floating pane.
.Fl D , .Fl D ,
.Fl L , .Fl L ,
@@ -3371,6 +3373,10 @@ which may be one of:
and and
.Fl Y .Fl Y
move it to an absolute position. move it to an absolute position.
.Fl z
moves the pane to the given
.Ar z-index ,
where zero is the front.
.Tg movew .Tg movew
.It Xo Ic move\-window .It Xo Ic move\-window
.Op Fl abrdk .Op Fl abrdk