Commit Graph

58 Commits

Author SHA1 Message Date
Dane Jensen
9d87097668 transitional 2026-07-22 17:18:36 -07:00
Dane Jensen
c2d05f0045 cleaned up lsvcmp 2026-07-21 08:41:36 -07:00
Dane Jensen
0588bd3522 fixed tokenization edge case.
...\\"... now exits properly.
2026-07-21 08:30:58 -07:00
Dane Jensen
6e1e74c382 Fixed whitespace parsing bug for literals. 2026-07-20 20:18:06 -07:00
Dane Jensen
40aacd9e46 Bug fixes and touchups. 2026-07-20 17:59:09 -07:00
Dane Jensen
a2d6351c14 missing const 2026-07-20 15:55:41 -07:00
Dane Jensen
6eaf8489a8 Updated comments. 2026-07-20 15:53:48 -07:00
Dane Jensen
94f47287fe fixes from feedback.
Also moved away from individual allocations and implemented basic string
views.
2026-07-20 15:46:37 -07:00
Dane Jensen
17778d4082 Bug fixes.
Lots of memory leak/double frees.
2026-07-19 22:11:36 -07:00
Dane Jensen
1210421843 bug fix 2026-07-19 18:57:42 -07:00
Dane Jensen
d8a919c322 comment clarity. 2026-07-19 14:26:15 -07:00
Dane Jensen
4b6d9157a4 Fixes from feedback.
Added a tokenizer and JSON parser for version 2. It is extendable to be
useful into the future. Converted `layout_append_v1` to use `struct
layout_string`.
2026-07-19 14:24:57 -07:00
Dane Jensen
3229ba3411 Added small comment to explain the two formats in layout-custom.c 2026-07-19 14:24:57 -07:00
Dane Jensen
eaf404d530 Old format does not dump floating cell information. 2026-07-19 14:24:57 -07:00
Dane Jensen
1bf58df934 Changed from feedback. 2026-07-19 14:24:57 -07:00
Dane Jensen
189b87aaae Changed key for top level layout field to "L" 2026-07-19 14:24:57 -07:00
Dane Jensen
bc7e267044 Changed v2 of the layout string format to be a subset of JSON. 2026-07-19 14:24:57 -07:00
Dane Jensen
8eb317b667 Added client flag to enable the new format when in control mode. Added
back the old format which is dispatched to. Also added attributes to the
format.
2026-07-19 14:24:53 -07:00
Dane Jensen
b448cf8726 Cleaned up some of the implementation and moved flags to the front. 2026-07-19 14:22:29 -07:00
Dane Jensen
5b6498ace4 Updated the layout string format to be more readable and include flags. 2026-07-19 14:22:29 -07:00
nicm
1d0d22df22 Fix uninitialized var for sscanf %n. 2026-07-16 16:43:21 +00:00
nicm
d29aa12117 Replace the notification system with events. Events can carry a payload of
additional payload (to reduce problems with lifetime of objects) and are
delivered to one or more event sinks. This is more powerful and reduces the
complex dependencies between control mode and hooks. Events are now used for
hooks, control mode notifications and for monitors (set-hook -B).

wait-for can now wait for an event to fire (-E flag, with -F to for filter),
with -v to print the payload, as well as listing (-l) waiting clients on an
event and forcing one to wake (-w).

A few additional hooks are also now available (pane-created, pane-resized, etc)
and some of the existing ones have additional format variables available.
2026-07-10 13:38:45 +00:00
nicm
7188391a22 Add a layout_geometry container struct, from Dane Jensen. 2026-07-07 08:07:26 +00:00
nicm
824ef37f5f Change layout sets to build the layout using the new mechanics, from
Dane Jensen.
2026-07-01 16:43:14 +00:00
nicm
97472e374f Return early if connect construct cell, reported by Jere Viikari. 2026-06-14 08:47:44 +00:00
nicm
ae6a749d3a Move the PANE_FLOATING flag into the layout cell and add an accessor.
From Dane Jensen.
2026-06-02 08:13:50 +00:00
nicm
b368e89bea Remove LAYOUT_FLOATING and disable custom layouts with floating panes
for now, from Dane Jensen.
2026-06-01 20:09:26 +00:00
nicm
ca95153b45 Preserve flags when creating new cells, from Brian Youngs. 2026-05-25 07:55:46 +00:00
nicm
f047b3f8e7 Do not crash when freeing layout cell, reported by Jere Viikari. 2026-05-24 08:40:43 +00:00
nicm
5c3a4746b7 Some code tidying up. 2026-05-23 07:22:50 +00:00
nicm
572e26deb8 Some more trivial floating panes bits. 2026-05-20 08:54:40 +00:00
nicm
34e2035bad More bits for pane Z index tracking from floating panes, mostly by
Michael Grant.
2026-05-19 09:48:14 +00:00
nicm
a8520ba59e Bring over some of layout and positioning code for floating panes, by
Michael Grant.
2026-05-17 16:01:42 +00:00
nicm
496805476e Require layout prefix to be 5 characters, GitHub issue 5067 from
cglosner at gmail dot com.
2026-05-07 09:21:05 +00:00
nicm
87aaff5fae Bring some new formats from the floating panes work: pane_zoomed_flag,
pane_flags, pane_floating_flag. By Michael Grant.
2026-04-04 16:40:27 +00:00
nicm
e8530c9fee Fixes for memory leaks reported by Lu Ming Yin, fixes from Howard Chu. 2024-04-15 08:19:55 +00:00
nicm
f10854cfc5 Add a missing error message which causes an invalid layout name to crash. 2023-02-02 09:24:59 +00:00
nicm
4ae2c64657 Better error reporting when applying custom layouts. 2022-05-30 12:52:02 +00:00
nicm
d98f9f7fe5 Add split-window -Z to start the pane zoomed, GitHub issue 2591. 2021-03-11 06:31:05 +00:00
nicm
2349b1dbef Make a best effort to set xpixel and ypixel for each pane and add
formats for them.
2019-11-28 09:45:15 +00:00
nicm
2cb268d51b Do not crash trying to fix layout size if only one cell, from Azat Khuzhin. 2019-10-19 12:40:42 +00:00
nicm
bbe8ebf9c2 Some old tmux versions can sometimes generate layout strings which have
the incorrect size for the top cell. Previously tmux didn't care but now
that panes can be partly hidden, the size matters and is checked more
strictly. So add some code to fix up the most common problem and a
sanity check to reject layouts with any other size problems. Reported by
Aleksandrs Ledovskis in GitHub issue 1930.
2019-10-14 09:16:48 +00:00
nicm
f4c7141f5d Do not lazily use BUFSIZ for "I don't care what size" when building
strings because it is only guaranteed to be 256 bytes and even the
default 1024 is not always enough. Reported by Gregory Pakosz.
2019-10-03 10:24:05 +00:00
nicm
6ceeceab7a Make layout_fix_offsets take a window like layout_fix_panes. 2019-07-15 18:25:07 +00:00
nicm
03da0ced46 Use the right format modifier when comparing, and remove a couple of
unused variables.
2019-06-15 06:33:48 +00:00
nicm
9d42bd328c Do not always resize the window back to its original size after applying
a layout, let the normal window resize process do it. This means windows
are not resized at all if window-size is manual, and are not resized
multiple times if later attached to a different size terminal.
2019-06-12 08:08:33 +00:00
nicm
646995384d Support for windows larger than visible on the attached client. This has
been a limitation for a long time.

There are two new options, window-size and default-size, and a new
command, resize-window. The force-width and force-height options and the
session_width and session_height formats have been removed.

The new window-size option tells tmux how to work out the size of
windows: largest means it picks the size of the largest session,
smallest the smallest session (similar to the old behaviour) and manual
means that it does not automatically resize windows. The default is
currently largest but this may change. aggressive-resize modifies the
choice of session for largest and smallest as it did before.

If a window is in a session attached to a client that is too small, only
part of the window is shown. tmux attempts to keep the cursor visible,
so the part of the window displayed is changed as the cursor moves (with
a small delay, to try and avoid excess redrawing when applications
redraw status lines or similar that are not currently visible). The
offset of the visible portion of the window is shown in status-right.

Drawing windows which are larger than the client is not as efficient as
those which fit, particularly when the cursor moves, so it is
recommended to avoid using this on slow machines or networks (set
window-size to smallest or manual).

The resize-window command can be used to resize a window manually. If it
is used, the window-size option is automatically set to manual for the
window (undo this with "setw -u window-size"). resize-window works in a
similar way to resize-pane (-U -D -L -R -x -y flags) but also has -a and
-A flags. -a sets the window to the size of the smallest client (what it
would be if window-size was smallest) and -A the largest.

For the same behaviour as force-width or force-height, use resize-window
-x or -y, and "setw -u window-size" to revert to automatic sizing..

If the global window-size option is set to manual, the default-size
option is used for new windows. If -x or -y is used with new-session,
that sets the default-size option for the new session.

The maximum size of a window is 10000x10000. But expect applications to
complain and much higher memory use if making a window excessively
big. The minimum size is the size required for the current layout
including borders.

The refresh-client command can be used to pan around a window, -U -D -L
-R moves up, down, left or right and -c returns to automatic cursor
tracking. The position is reset when the current window is changed.
2018-10-18 08:38:01 +00:00
nicm
41e633acf5 Use the notify name string instead of going via an enum and change
existing hooks to use notifys instead.
2016-10-16 22:06:40 +00:00
nicm
f8cc48a43f Fix minimum size when pane status line is enabled, reported by Y Petremann. 2016-08-03 09:07:02 +00:00
nicm
68b1fd0cc6 Wrap some long lines and apply some static. 2016-07-15 09:27:35 +00:00