mirror of
https://github.com/tmux/tmux.git
synced 2026-09-21 12:28:14 +00:00
layout-custom: emit an empty v1 body for windows with only floating panes
layout_append() returned failure for the version 1 (old) layout format
when a window's tree has no tiled cell anywhere - e.g. a window left
with only floating panes after the last tiled pane closed. layout_dump()
turns that failure into NULL, surfacing as an empty #{window_layout}
instead of the minimal valid placeholder body a control client or
select-layout round-trip expects. Return success with nothing written
instead, which composes into the checksum-prefixed empty body via the
existing formatting path.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -509,7 +509,7 @@ layout_append(struct layout_cell *lcroot, struct layout_string *ls, int flags)
|
||||
if (flags & LAYOUT_CUSTOM_OLD_FORMAT) {
|
||||
if (!layout_cell_is_tiled(lcroot) &&
|
||||
!layout_cell_has_tiled_child(lcroot))
|
||||
return (-1);
|
||||
return (0); /* no tiled cell anywhere: empty v1 body */
|
||||
lccompat = layout_custom_create_compat(lcroot);
|
||||
result = layout_append_v1(lccompat, ls);
|
||||
layout_custom_free_compat(lccompat);
|
||||
|
||||
Reference in New Issue
Block a user