Commit Graph

11556 Commits

Author SHA1 Message Date
Michael Grant
d138519eaf Merge branch 'master' into 5211-fix-select-layout-list-windows 2026-07-05 17:21:23 +01:00
Michael Grant
fb8f266a21 Add control mode flag window-layout-v2 to return new list-windows layout format. 2026-07-05 14:03:54 +01:00
Michael Grant
2c26557b90 Cleanup. 2026-07-04 21:52:47 +01:00
Michael Grant
2a7d3110a2 Merge branch '5211-fix-select-layout-list-windows' of github.com:tmux/tmux into 5211-fix-select-layout-list-windows 2026-07-04 13:35:34 +01:00
Michael Grant
adefff2667 Make if clearer. 2026-07-04 13:35:16 +01:00
Nicholas Marriott
3170c6460d Add some more custom layout tests. 2026-07-03 21:08:20 +01:00
Thomas Adam
90fc51542f Merge branch 'obsd-master' 2026-06-30 11:30:06 +01:00
nicm
f8674cc993 Add default features for Ghostty, GitHub issue 5305 from Glib Shpychka. 2026-06-30 10:07:05 +00:00
Thomas Adam
843adbf454 Merge branch 'obsd-master' 2026-06-30 10:30:06 +01:00
nicm
abefc3f705 Redraw when sync stops again (accidentally turned off), from Japin Li in
GitHub issue 5304.
2026-06-30 09:20:43 +00:00
Michael Grant
f9d31962b2 Cleanup work
Key changes:

  - Added a prepared-layout API in layout-custom.c:
      - Parse and validate once.
      - Retain the validated temporary tree.
      - Apply through a no-failure, consuming operation.

  - Multi-window layouts prepare every record before changing any window.
  - Removed duplicate parsing, recalculation, and notification work.
  - Restored very old legacy layouts where pane IDs are absent.
  - Added structural validation before and after surplus-cell pruning.
  - Split pane-ID uniqueness and matching logic.
  - Renamed LAYOUT_FORMAT_NEW to LAYOUT_FORMAT.
  - Kept LAYOUT_CELL_HIDDEN as the requested serialization/rendering marker
    only.

  - Updated documentation and regression coverage, including:
      - Historical bb62,... layouts.
      - Malformed discarded cells.
      - Maximum parser nesting depth.
2026-06-30 10:40:19 +02:00
Thomas Adam
dddd7b44c8 Merge branch 'obsd-master' 2026-06-30 08:15:06 +01:00
Nicholas Marriott
25c874c489 Merge branch 'release_3.7a' 2026-06-30 07:46:06 +01:00
Nicholas Marriott
0e418b62d2 Remove C-r from help. 3.7a 2026-06-30 07:44:51 +01:00
nicm
a97f643bd3 Remove C-r from help since it does not in fact exist. 2026-06-30 06:44:46 +00:00
Nicholas Marriott
78a2145a47 Update CHANGES. 2026-06-30 07:42:25 +01:00
Nicholas Marriott
dbe50934b1 Add caching of scrollbar options to 3.7a branch. 2026-06-30 07:41:02 +01:00
Thomas Adam
543d104f85 Merge branch 'obsd-master' 2026-06-29 20:15:07 +01:00
nicm
e06207c914 Cache scrollbar options in window to avoid a slow lookup when working
out visible ranges.
2026-06-29 19:03:34 +00:00
nicm
166267c87a Allow :. in names again, forbidding them is overly pernickety. Only
forbid invalid UTF-8 and #(.
2026-06-29 19:53:42 +01:00
Thomas Adam
91e0737b8a Merge branch 'obsd-master' 2026-06-29 19:30:07 +01:00
nicm
65a032b205 Allow :. in names again, forbidding them is overly pernickety. Only
forbid invalid UTF-8 and #(.
2026-06-29 18:17:28 +00:00
Thomas Adam
80c7dcdbd7 Merge branch 'obsd-master' 2026-06-29 18:30:06 +01:00
Michael Grant
fbaa3cb565 Merge branch 'master' into 5211-fix-select-layout-list-windows 2026-06-29 19:26:12 +02:00
nicm
bcd54d12d8 Add link=/nolink to styles to specific a hyperlink. GitHub issue 4280
from Moritz Angermann.
2026-06-29 17:08:52 +00:00
Thomas Adam
726e19a886 Merge branch 'obsd-master' 2026-06-29 18:00:06 +01:00
nicm
95719e342d Limit hyperlink URIs to 1024 bytes which seems enough and allows us not
to have to worry about gigantic URIs in styles, part of a change from
Moritz Angermann.
2026-06-29 16:44:06 +00:00
nicm
132a63d1da Allow empty window and session names. 2026-06-29 17:36:40 +01:00
Thomas Adam
822f700b15 Merge branch 'obsd-master' 2026-06-29 17:30:06 +01:00
nicm
5df51a06f5 Allow empty window and session names. 2026-06-29 16:20:45 +00:00
Michael Grant
64db144425 Update select-layout and list-windows to work with new layouts,
floating panes, and use a more modern serialization format.

  ## Serialization

  layout-custom.c now emits a canonical current format with:

  - Pane syntax: %pane-id,z-index:geometry[:flags]
  - Semicolons between child cells.
  - X-style geometry: WxH+X+Y
  - Every pane represented inside layout_root, including floating panes.
  - No legacy <...> floating-pane wrapper.
  - Z-index serialized for tiled and floating panes.
  - Flags:
      - f: floating
      - h: hidden
      - z: zoomed

  - Hidden panes use their saved restoration geometry.
  - Single-pane windows serialize as a pane root cell.

  window_layout and list-windows continue emitting a four-digit checksum.

  ## Geometry

  Current layouts accept:

  - +N: absolute positive offset
  - ++N: equivalent to +N
  - +-N: absolute negative offset
  - -N: right/bottom-relative offset for floating panes
  - Omitted offsets: +0+0
  - One offset: second defaults to +0

  Relative offsets are resolved immediately. Output always contains canonical absolute
  coordinates.

  Widths and heights are restricted to 1..PANE_MAXIMUM; offsets and resolved offsets are
  restricted to -PANE_MAXIMUM..PANE_MAXIMUM.

  ## Checksums and whitespace

  - The outer checksum is optional on input for current and legacy layouts.
  - If supplied, it must be correct.
  - Output still includes it.
  - Checksums cover all non-whitespace layout text.
  - Whitespace and newlines may be inserted between tokens.
  - Optional nested checksums are accepted and validated but not emitted.

  ## Legacy compatibility

  Legacy comma-separated layouts remain accepted:

  WxH,x,y{cell,cell,...}
  WxH,x,y,pane-id

  Additional compatibility behavior includes:

  - The reported e6db,113x28,... layout works and resizes existing panes correctly.
  - Older inconsistent root dimensions are corrected safely.
  - Legacy layouts with surplus cells continue pruning cells until the target pane count
    matches.

  - Legacy panes remain assigned in tree order.
  - Legacy input is re-emitted in the current canonical format.

  Mixed legacy/current syntax is rejected.

  ## Pane matching and counts

  For current layouts:

  - Pane IDs must be unique.
  - With matching pane counts:
      - An exact ID set maps panes by identity.
      - A completely disjoint ID set maps panes in tree order.
      - A partial ID match is rejected as ambiguous.

  - If the target has fewer panes:
      - Cells are removed from the end of the tree.
      - Remaining z-indexes are compacted while preserving order.
      - Existing panes are assigned in tree order.
      - No panes are killed or created.

  - A target with more panes than layout cells is rejected.

  Layouts are therefore snapshots that rearrange existing panes and windows, not complete
  session-restoration data.

  ## Validation and safety

  Parsing now constructs and validates a temporary tree before replacing the active layout:

  - Maximum input length: 8192 bytes.
  - Maximum nesting depth: 64.
  - Checked signed and unsigned numeric parsing.
  - Dimension and offset bounds.
  - Container size consistency.
  - Exact trailing-input checks.
  - Unique, contiguous z-indexes starting at zero.
  - Floating panes must precede tiled panes in z-order.
  - Unknown and duplicate flags are rejected.
  - Hidden and zoomed flags cannot be combined.
  - Only one pane may be zoomed.
  - Relative positioning is accepted only for floating panes.
  - Overflow-safe size aggregation.

  Invalid single-window layouts are validated before the window is unzoomed. Multi-window
  layouts are all validated before any window is changed.

  ## Multi-window layouts

  cmd-select-layout.c accepts:

  @window-id:layout[@window-id:layout...]

  Records may be adjacent or separated by whitespace/newlines. Unknown and duplicate window IDs
  are rejected.

  This allows direct reuse of:

  tmux list-windows -F '#{window_id}:#{window_layout}'

  ## Supporting runtime changes

  - tmux.h adds parsed pane IDs, z-indexes, hidden/zoomed/relative cell flags, and
    layout_validate.

  - layout.c initializes parsed metadata safely.
  - window.c treats hidden cells, including saved cells, as non-visible.

  ## Documentation

  tmux.1 now documents:

  - Current and legacy grammars.
  - Geometry and flags.
  - Z-index and pane-ID rules.
  - Optional checksums.
  - Multi-window wrappers.
  - Pane-count pruning.
  - Snapshot versus session-restoration semantics.

  The authoritative description is under select-layout; list-windows and list-panes reference
  it.

  ## Tests

  Added regress/layout-custom.sh covering serialization, compatibility, validation, geometry,
  IDs, pruning, flags, zoom, checksums, whitespace, and multi-window application.

  Updated regress/control-client-sanity.sh for canonical output.

  Verified:

  - Debug build
  - Layout regression
  - Floating-pane geometry regression
  - Control-client regression
  - Man-page rendering
  - git diff --check
2026-06-29 17:47:28 +02:00
Nicholas Marriott
ad74c5ed7f Add additional grid consistency checks for macOS. 2026-06-29 10:20:38 +01:00
Thomas Adam
d5284be91d Merge branch 'obsd-master' 2026-06-29 09:00:09 +01:00
nicm
c29b41e527 Make pane scrollbars able to auto-hide after a short timeout. This
replaces the previous "modal" behaviour where the pane would be resized,
which tended to make a mess. Instead, the scrollbar appears when
scrolling or when hovered over with the mouse and disappears a
(configurable) short period later. From Michael Grant.
2026-06-29 07:45:09 +00:00
nicm
4e612612dc Only forbid #( in names and titles (styles are #[ and are useful). 2026-06-29 08:11:08 +01:00
Thomas Adam
705fbf92ee Merge branch 'obsd-master' 2026-06-28 21:49:05 +01:00
Nicholas Marriott
2dc704abb6 Always set SIXEL aspect ratio to 1:1, GitHub issue 5291 from James Holderness. 2026-06-28 17:01:52 +01:00
Nicholas Marriott
6c2ef75681 Bump version. 2026-06-28 16:54:51 +01:00
nicm
96899dc527 Only forbid #( in names and titles (styles are #[ and are useful). 2026-06-28 15:53:18 +00:00
Your Name
b0db912bde Update check-names test. 2026-06-28 16:52:28 +01:00
nicm
7cd33ce0dd Set view name immediately when entering mode. 2026-06-27 12:37:36 +00:00
nicm
e0dd40f812 Clear lines before writing in copy mode to avoid leaving stray text when
new line is shorter than old.
2026-06-27 12:27:43 +00:00
nicm
79f0f97495 Make split-window create a new floating pane if used in a floating pane,
rather than just complaining. Also improve documentation. From Dane
Jensen.
2026-06-27 10:23:14 +00:00
nicm
5e0b0a2aa3 Pulled code out of layout_split_pane for reuse and added
layout_insert_tile. From Dane Jensen.
2026-06-27 10:21:26 +00:00
nicm
e24969b422 Add a helper to swap a node into the place of a leaf, from Dane Jensen. 2026-06-27 10:18:32 +00:00
nicm
dd02989e88 Invalidate scene when changing window Z index, from Dane Jensen. 2026-06-27 10:16:15 +00:00
nicm
7383c04205 Preseve prompt flags across line clear, from Aung Myo Kyaw. 2026-06-27 10:05:38 +00:00
Nicholas Marriott
84291b021f Fix check so as to not use NULL name. 2026-06-27 10:58:39 +01:00
Thomas Adam
91e30f4f22 Merge branch 'obsd-master' 2026-06-26 21:15:06 +01:00
nicm
5be44a6c03 Use linked sessions not active. 2026-06-26 19:53:47 +00:00