From 21dce04dcabc116f917f03826abf96ad439aeeeb Mon Sep 17 00:00:00 2001 From: Michael Grant Date: Sun, 5 Jul 2026 18:01:02 +0100 Subject: [PATCH] Changed the name of the option from window-layout-v2 to window-layout-new. --- format.c | 2 +- regress/control-client-layout.sh | 16 ++++++++-------- server-client.c | 8 ++++---- tmux.1 | 10 +++++----- tmux.h | 2 +- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/format.c b/format.c index 6bbfda486..e1869c37a 100644 --- a/format.c +++ b/format.c @@ -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)); } diff --git a/regress/control-client-layout.sh b/regress/control-client-layout.sh index afe8d4cd5..f0cd72efc 100644 --- a/regress/control-client-layout.sh +++ b/regress/control-client-layout.sh @@ -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. diff --git a/server-client.c b/server-client.c index b1d2cbab5..2b3da6c22 100644 --- a/server-client.c +++ b/server-client.c @@ -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); diff --git a/tmux.1 b/tmux.1 index 9816525c6..027b3cd77 100644 --- a/tmux.1 +++ b/tmux.1 @@ -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 diff --git a/tmux.h b/tmux.h index e9d2af014..f5bfd34b2 100644 --- a/tmux.h +++ b/tmux.h @@ -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 */