Changed the name of the option from window-layout-v2 to window-layout-new.

This commit is contained in:
Michael Grant
2026-07-05 18:01:02 +01:00
parent 28e6b66cc3
commit 21dce04dca
5 changed files with 19 additions and 19 deletions

View File

@@ -849,7 +849,7 @@ static char *
format_window_layout(struct format_tree *ft, struct layout_cell *root)
{
if (ft->c != NULL && (ft->c->flags & CLIENT_CONTROL) &&
(ft->c->flags & CLIENT_CONTROL_WINDOWLAYOUTV2) == 0)
(ft->c->flags & CLIENT_CONTROL_WINDOWLAYOUT_NEW) == 0)
return (layout_dump_legacy(root));
return (layout_dump(ft->w, root));
}

View File

@@ -25,7 +25,7 @@ $TMUX split-window -h || exit 1
$TMUX new-pane -x20 -y8 -X5 -Y3 || exit 1
$TMUX -C attach <&3 >"$OUT1" &
$TMUX -C attach -f window-layout-v2 <&4 >"$OUT2" &
$TMUX -C attach -f window-layout-new <&4 >"$OUT2" &
sleep 1
printf '%s\n' "list-windows -F 'layout:#{client_flags}:#{window_layout}'" >&3
@@ -35,22 +35,22 @@ printf '%s\n' "display-message -p 'layout:#{client_flags}:#{window_layout}'" >&3
printf '%s\n' "list-windows -F 'layout:#{client_flags}:#{window_layout}'" >&4
sleep 1
# Default control output is legacy; window-layout-v2 output is current.
# Default control output is legacy; window-layout-new output is current.
awk '/^layout:/ { print }' "$OUT1" | while IFS= read -r line; do
case "$line" in
*window-layout-v2*|*%0,*|*';'*) exit 1 ;;
*window-layout-new*|*%0,*|*';'*) exit 1 ;;
esac
done || exit 1
[ "$(grep -ac '^layout:' "$OUT1")" -eq 6 ] || exit 1
grep -a '^layout:.*window-layout-v2.*%0,' "$OUT2" >/dev/null || exit 1
grep -a '^layout:.*window-layout-new.*%0,' "$OUT2" >/dev/null || exit 1
# Toggling the flag changes subsequent format expansion for the same client.
printf '%s\n' "refresh-client -f window-layout-v2" >&3
printf '%s\n' "display-message -p 'v2:#{client_flags}:#{window_layout}'" >&3
printf '%s\n' "refresh-client -f '!window-layout-v2'" >&3
printf '%s\n' "refresh-client -f window-layout-new" >&3
printf '%s\n' "display-message -p 'new:#{client_flags}:#{window_layout}'" >&3
printf '%s\n' "refresh-client -f '!window-layout-new'" >&3
printf '%s\n' "display-message -p 'legacy:#{client_flags}:#{window_layout}'" >&3
sleep 1
grep -a '^v2:.*window-layout-v2.*%0,' "$OUT1" >/dev/null || exit 1
grep -a '^new:.*window-layout-new.*%0,' "$OUT1" >/dev/null || exit 1
grep -a '^legacy:' "$OUT1" | tail -1 | grep -v '%0,' >/dev/null || exit 1
# One layout change is formatted independently for each connected client.

View File

@@ -2846,8 +2846,8 @@ server_client_control_flags(struct client *c, const char *next)
return (CLIENT_CONTROL_NOOUTPUT);
if (strcmp(next, "wait-exit") == 0)
return (CLIENT_CONTROL_WAITEXIT);
if (strcmp(next, "window-layout-v2") == 0)
return (CLIENT_CONTROL_WINDOWLAYOUTV2);
if (strcmp(next, "window-layout-new") == 0)
return (CLIENT_CONTROL_WINDOWLAYOUT_NEW);
return (0);
}
@@ -2916,8 +2916,8 @@ server_client_get_flags(struct client *c)
strlcat(s, "no-output,", sizeof s);
if (c->flags & CLIENT_CONTROL_WAITEXIT)
strlcat(s, "wait-exit,", sizeof s);
if (c->flags & CLIENT_CONTROL_WINDOWLAYOUTV2)
strlcat(s, "window-layout-v2,", sizeof s);
if (c->flags & CLIENT_CONTROL_WINDOWLAYOUT_NEW)
strlcat(s, "window-layout-new,", sizeof s);
if (c->flags & CLIENT_CONTROL_PAUSEAFTER) {
xsnprintf(tmp, sizeof tmp, "pause-after=%u,",
c->pause_age / 1000);

10
tmux.1
View File

@@ -1113,7 +1113,7 @@ The flags are:
the client has an independent active pane
.It ignore\-size
the client does not affect the size of other clients
.It window\-layout\-v2
.It window\-layout\-new
the client receives the current layout serialization in control mode rather
than the legacy serialization
.It no\-detach\-on\-destroy
@@ -3402,7 +3402,7 @@ It is repeated for each pane from the same window.
Its format is described under
.Ic select\-layout .
In control mode, it uses the legacy format unless the client has the
.Ql window\-layout\-v2
.Ql window\-layout\-new
flag.
.Tg lsw
.It Xo Ic list\-windows
@@ -3446,7 +3446,7 @@ format variable.
The format is described under
.Ic select\-layout .
In control mode, the legacy format is used unless the client has the
.Ql window\-layout\-v2
.Ql window\-layout\-new
flag.
.Pp
Layouts for multiple windows may be produced in a form suitable for
@@ -4104,7 +4104,7 @@ and
.Ql window_visible_layout
generate the current format with a checksum.
In control mode, they generate the legacy format by default; a client with the
.Ql window\-layout\-v2
.Ql window\-layout\-new
flag receives the current format instead.
.Ic list\-windows
uses
@@ -9004,7 +9004,7 @@ The window's visible layout is
and the window flags are
.Ar window\-flags .
The layouts use the legacy serialization unless the client has the
.Ql window\-layout\-v2
.Ql window\-layout\-new
flag, in which case they use the current serialization.
.It Ic %message Ar message
A message sent with the

2
tmux.h
View File

@@ -2250,7 +2250,7 @@ struct client {
#define CLIENT_CONTROL_PAUSEAFTER 0x100000000ULL
#define CLIENT_CONTROL_WAITEXIT 0x200000000ULL
#define CLIENT_WINDOWSIZECHANGED 0x400000000ULL
#define CLIENT_CONTROL_WINDOWLAYOUTV2 0x800000000ULL
#define CLIENT_CONTROL_WINDOWLAYOUT_NEW 0x800000000ULL
#define CLIENT_BRACKETPASTING 0x1000000000ULL
#define CLIENT_ASSUMEPASTING 0x2000000000ULL
/* 0x4000000000ULL unused */