From 1fe9cbacb4ad642849c682b20038e456659e8e87 Mon Sep 17 00:00:00 2001 From: Michael Grant Date: Mon, 6 Jul 2026 16:46:56 +0100 Subject: [PATCH] Rename the flag to CLIENT_CONTROL_NEWWINDOWLAYOUTS/new-window-layouts. --- format.c | 2 +- regress/control-client-layout.sh | 14 +++++++------- server-client.c | 8 ++++---- tmux.1 | 10 +++++----- tmux.h | 2 +- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/format.c b/format.c index e1869c37a..de0e3afaf 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_WINDOWLAYOUT_NEW) == 0) + (ft->c->flags & CLIENT_CONTROL_NEWWINDOWLAYOUTS) == 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 f4d8460d4..34af12777 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-new <&4 >"$OUT2" & +$TMUX -C attach -f new-window-layouts <&4 >"$OUT2" & sleep 1 printf '%s\n' "list-windows -F 'layout:#{client_flags}:#{window_layout}'" >&3 @@ -35,23 +35,23 @@ 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-new output is current. +# Default control output is legacy; new-window-layouts output is current. awk '/^layout:/ { print }' "$OUT1" | while IFS= read -r line; do case "$line" in - *window-layout-new*|*v2:*|*%0,*|*';'*) exit 1 ;; + *new-window-layouts*|*v2:*|*%0,*|*';'*) exit 1 ;; esac done || exit 1 [ "$(grep -ac '^layout:' "$OUT1")" -eq 6 ] || exit 1 -grep -a '^layout:.*window-layout-new.*,v2:.*%0,' "$OUT2" >/dev/null || +grep -a '^layout:.*new-window-layouts.*,v2:.*%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-new" >&3 +printf '%s\n' "refresh-client -f new-window-layouts" >&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' "refresh-client -f '!new-window-layouts'" >&3 printf '%s\n' "display-message -p 'legacy:#{client_flags}:#{window_layout}'" >&3 sleep 1 -grep -a '^new:.*window-layout-new.*,v2:.*%0,' "$OUT1" >/dev/null || +grep -a '^new:.*new-window-layouts.*,v2:.*%0,' "$OUT1" >/dev/null || exit 1 grep -a '^legacy:' "$OUT1" | tail -1 | grep -v '%0,' >/dev/null || exit 1 diff --git a/server-client.c b/server-client.c index 2b3da6c22..ed1eb7324 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-new") == 0) - return (CLIENT_CONTROL_WINDOWLAYOUT_NEW); + if (strcmp(next, "new-window-layouts") == 0) + return (CLIENT_CONTROL_NEWWINDOWLAYOUTS); 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_WINDOWLAYOUT_NEW) - strlcat(s, "window-layout-new,", sizeof s); + if (c->flags & CLIENT_CONTROL_NEWWINDOWLAYOUTS) + strlcat(s, "new-window-layouts,", 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 70514aed0..bb7d80077 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\-new +.It new\-window\-layouts 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\-new +.Ql new\-window\-layouts 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\-new +.Ql new\-window\-layouts flag. .Pp Layouts for multiple windows may be produced in a form suitable for @@ -4118,7 +4118,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\-new +.Ql new\-window\-layouts flag receives the current format instead. .Ic list\-windows uses @@ -9018,7 +9018,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\-new +.Ql new\-window\-layouts 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 f5bfd34b2..f93fbaf78 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_WINDOWLAYOUT_NEW 0x800000000ULL +#define CLIENT_CONTROL_NEWWINDOWLAYOUTS 0x800000000ULL #define CLIENT_BRACKETPASTING 0x1000000000ULL #define CLIENT_ASSUMEPASTING 0x2000000000ULL /* 0x4000000000ULL unused */