OpenBSD CVS

CVS log for src/usr.bin/tmux/resize.c


[BACK] Up to [local] / src / usr.bin / tmux

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.51 / (download) - annotate - [select for diffs], Thu Mar 21 11:30:42 2024 UTC (8 weeks, 2 days ago) by nicm
Branch: MAIN
CVS Tags: HEAD
Changes since 1.50: +2 -2 lines
Diff to previous 1.50 (colored)

Do not notify window-layout-changed if the window is about to be
destroyed (since it may have been freed by the time the notify happens),
from Romain Francoise in GitHub issue 3860.

Revision 1.50 / (download) - annotate - [select for diffs], Thu Feb 17 09:58:47 2022 UTC (2 years, 3 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1
Changes since 1.49: +2 -1 lines
Diff to previous 1.49 (colored)

Add a window-resized hook which is fired when the window is actually
resized which may be later than the client resize, GitHub issue 2995.

Revision 1.49 / (download) - annotate - [select for diffs], Thu Jan 6 08:20:00 2022 UTC (2 years, 4 months ago) by nicm
Branch: MAIN
Changes since 1.48: +2 -2 lines
Diff to previous 1.48 (colored)

Ignore windows without a size set (may be used for pane only), from
Anindya Mukherjee.

Revision 1.48 / (download) - annotate - [select for diffs], Mon Dec 6 10:08:42 2021 UTC (2 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.47: +3 -1 lines
Diff to previous 1.47 (colored)

Do not dereference NULL window when resizing client, GitHub issue 2982.

Revision 1.47 / (download) - annotate - [select for diffs], Fri Aug 27 17:15:57 2021 UTC (2 years, 8 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE, OPENBSD_7_0
Changes since 1.46: +77 -18 lines
Diff to previous 1.46 (colored)

Allow control mode clients to set a hard limit on the window width and
height, GitHub issue 2594.

Revision 1.46 / (download) - annotate - [select for diffs], Wed Aug 25 10:18:01 2021 UTC (2 years, 8 months ago) by nicm
Branch: MAIN
Changes since 1.45: +17 -14 lines
Diff to previous 1.45 (colored)

Improve some logging.

Revision 1.45 / (download) - annotate - [select for diffs], Wed Aug 25 10:15:15 2021 UTC (2 years, 8 months ago) by nicm
Branch: MAIN
Changes since 1.44: +8 -1 lines
Diff to previous 1.44 (colored)

Ignore client creating session when working out size if it is a control
client.

Revision 1.44 / (download) - annotate - [select for diffs], Thu Jun 10 07:29:45 2021 UTC (2 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.43: +2 -2 lines
Diff to previous 1.43 (colored)

Do not count client (and crash) if no window.

Revision 1.43 / (download) - annotate - [select for diffs], Thu Jun 10 07:24:45 2021 UTC (2 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.42: +34 -15 lines
Diff to previous 1.42 (colored)

Include current client in size calculation for new sessions, GitHub
issue 2662.

Revision 1.42 / (download) - annotate - [select for diffs], Mon Oct 5 10:00:51 2020 UTC (3 years, 7 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_9_BASE, OPENBSD_6_9
Changes since 1.41: +169 -210 lines
Diff to previous 1.41 (colored)

Tidy the resize code, merge some common bits and add some comments. From
"Mike" in GitHub issue 2392.

Revision 1.41 / (download) - annotate - [select for diffs], Fri Jun 5 07:33:57 2020 UTC (3 years, 11 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8
Changes since 1.40: +12 -6 lines
Diff to previous 1.40 (colored)

Add support for pausing a pane when the output buffered for a control
mode client gets too far behind. The pause-after flag with a time is set
on the pane with refresh-client -f and a paused pane may be resumed with
refresh-client -A. GitHub issue 2217.

Revision 1.40 / (download) - annotate - [select for diffs], Sat May 16 16:50:55 2020 UTC (4 years ago) by nicm
Branch: MAIN
Changes since 1.39: +21 -6 lines
Diff to previous 1.39 (colored)

Move lazy resize from the pane to the window, there is no point in
resizing the window unless it is the current window, and if we do and
don't resize the pane until later there are problems if the size changes
from A to B then back to A.

Revision 1.39 / (download) - annotate - [select for diffs], Sat May 16 15:45:29 2020 UTC (4 years ago) by nicm
Branch: MAIN
Changes since 1.38: +5 -5 lines
Diff to previous 1.38 (colored)

Change the existing client flags for control mode to apply for any
client, use the same mechanism for the read-only flag and add an
ignore-size flag.

refresh-client -F has become -f (-F stays for backwards compatibility)
and attach-session and switch-client now have -f flags also. A new
format "client_flags" lists the flags and is shown by list-clients by
default.

This separates the read-only flag from "ignore size" behaviour (new
ignore-size) flag - both behaviours are useful in different
circumstances.

attach -r and switchc -r remain and set or toggle both flags together.

Revision 1.38 / (download) - annotate - [select for diffs], Tue Jan 28 13:23:24 2020 UTC (4 years, 3 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.37: +17 -1 lines
Diff to previous 1.37 (colored)

If ALL clients are readonly, allow them to affect the size, suggested by Thomas Sattler.

Revision 1.37 / (download) - annotate - [select for diffs], Tue Jan 28 08:06:11 2020 UTC (4 years, 3 months ago) by nicm
Branch: MAIN
Changes since 1.36: +4 -3 lines
Diff to previous 1.36 (colored)

Add a define for flags meaning a client is not attached, and fix
unattached counter, reported by Thomas Sattler.

Revision 1.36 / (download) - annotate - [select for diffs], Fri Nov 29 16:04:07 2019 UTC (4 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.35: +23 -5 lines
Diff to previous 1.35 (colored)

If a window appears in only one attached session, there is no point in
worrying about which is the latest client (there is only one).

Revision 1.35 / (download) - annotate - [select for diffs], Thu Nov 28 09:45:16 2019 UTC (4 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.34: +46 -7 lines
Diff to previous 1.34 (colored)

Make a best effort to set xpixel and ypixel for each pane and add
formats for them.

Revision 1.34 / (download) - annotate - [select for diffs], Mon Sep 23 15:41:11 2019 UTC (4 years, 7 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.33: +48 -21 lines
Diff to previous 1.33 (colored)

Use the correct size for new windows when window-size is latest,
reported by Vamsi Krishna Avula in GitHub issue 1917.

Revision 1.33 / (download) - annotate - [select for diffs], Thu Sep 19 09:02:30 2019 UTC (4 years, 8 months ago) by nicm
Branch: MAIN
Changes since 1.32: +112 -73 lines
Diff to previous 1.32 (colored)

Add a "latest" window-size option which tries to size windows based on
the most recently used client. From Tommie Gannert in GitHub issue 1869
based on earlier changes from me.

Revision 1.32 / (download) - annotate - [select for diffs], Sat May 11 06:34:56 2019 UTC (5 years ago) by nicm
Branch: MAIN
Changes since 1.31: +4 -3 lines
Diff to previous 1.31 (colored)

Do not reduce window height by status line height for control mode
clients, from George Nachman.

Revision 1.31 / (download) - annotate - [select for diffs], Wed Apr 17 14:43:49 2019 UTC (5 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.30: +3 -1 lines
Diff to previous 1.30 (colored)

Set the window size as well as the layout size when using the preset
layouts.

Revision 1.30 / (download) - annotate - [select for diffs], Sat Mar 16 17:14:07 2019 UTC (5 years, 2 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.29: +2 -2 lines
Diff to previous 1.29 (colored)

Tidy and rename some bits of status line code.

Revision 1.29 / (download) - annotate - [select for diffs], Tue Mar 12 13:56:30 2019 UTC (5 years, 2 months ago) by nicm
Branch: MAIN
Changes since 1.28: +24 -20 lines
Diff to previous 1.28 (colored)

Fix resizing of control clients, should be ignored until SIZECHANGED flag set.

Revision 1.28 / (download) - annotate - [select for diffs], Mon Mar 4 09:29:52 2019 UTC (5 years, 2 months ago) by nicm
Branch: MAIN
Changes since 1.27: +2 -2 lines
Diff to previous 1.27 (colored)

Fix sense of aggressive-resize flag.

Revision 1.27 / (download) - annotate - [select for diffs], Thu Oct 18 08:38:01 2018 UTC (5 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.26: +197 -113 lines
Diff to previous 1.26 (colored)

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.

Revision 1.26 / (download) - annotate - [select for diffs], Sat Aug 18 20:08:52 2018 UTC (5 years, 9 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.25: +3 -10 lines
Diff to previous 1.25 (colored)

SESSION_UNATTACHED flag is no longer necessary now we have an attached
count instead.

Revision 1.25 / (download) - annotate - [select for diffs], Mon Oct 16 19:30:53 2017 UTC (6 years, 7 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3
Changes since 1.24: +13 -9 lines
Diff to previous 1.24 (colored)

Infrastructure for drawing status lines of more than one line in height,
still only one is allowed but this lets tmux draw bigger ones.

Revision 1.24 / (download) - annotate - [select for diffs], Mon Aug 28 12:36:38 2017 UTC (6 years, 8 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.23: +3 -1 lines
Diff to previous 1.23 (colored)

Do not forbid targets to specify non-visible panes - the checks for
visibility are better where the target is used. GitHub issue 1049.

Revision 1.23 / (download) - annotate - [select for diffs], Wed May 10 16:48:36 2017 UTC (7 years ago) by nicm
Branch: MAIN
Changes since 1.22: +4 -1 lines
Diff to previous 1.22 (colored)

Prevent control clients from affecting the session size until they have
specified a size with refresh-client -C. Prompted by a different change
with the same purpose from George Nachman.

Revision 1.22 / (download) - annotate - [select for diffs], Wed Feb 8 13:53:32 2017 UTC (7 years, 3 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.21: +5 -5 lines
Diff to previous 1.21 (colored)

Improve some of the logging on resize.

Revision 1.21 / (download) - annotate - [select for diffs], Fri Feb 3 21:01:02 2017 UTC (7 years, 3 months ago) by nicm
Branch: MAIN
Changes since 1.20: +3 -1 lines
Diff to previous 1.20 (colored)

Cache status line position to reduce option lookups during output.

Revision 1.20 / (download) - annotate - [select for diffs], Sun Oct 16 22:06:40 2016 UTC (7 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.19: +2 -2 lines
Diff to previous 1.19 (colored)

Use the notify name string instead of going via an enum and change
existing hooks to use notifys instead.

Revision 1.19 / (download) - annotate - [select for diffs], Tue Jan 19 15:59:12 2016 UTC (8 years, 4 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.18: +2 -2 lines
Diff to previous 1.18 (colored)

I no longer use my SourceForge address so replace it.

Revision 1.18 / (download) - annotate - [select for diffs], Tue Oct 27 15:58:42 2015 UTC (8 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.17: +5 -5 lines
Diff to previous 1.17 (colored)

Move struct options into options.c.

Revision 1.17 / (download) - annotate - [select for diffs], Fri Apr 24 23:17:11 2015 UTC (9 years ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.16: +4 -5 lines
Diff to previous 1.16 (colored)

Convert clients list into a TAILQ.

Revision 1.16 / (download) - annotate - [select for diffs], Wed Apr 22 15:32:33 2015 UTC (9 years ago) by nicm
Branch: MAIN
Changes since 1.15: +2 -2 lines
Diff to previous 1.15 (colored)

Make session_has return a flag, returning the first winlink found is a
recipe for errors.

Revision 1.15 / (download) - annotate - [select for diffs], Wed Apr 22 15:30:11 2015 UTC (9 years ago) by nicm
Branch: MAIN
Changes since 1.14: +6 -7 lines
Diff to previous 1.14 (colored)

Change the windows array into an RB tree and fix some places where we
were only looking at the first winlink for a window in a session.

Revision 1.14 / (download) - annotate - [select for diffs], Fri Nov 14 02:19:47 2014 UTC (9 years, 6 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.13: +12 -4 lines
Diff to previous 1.13 (colored)

Label windows which are smaller than expected with a reason.

Revision 1.13 / (download) - annotate - [select for diffs], Wed Nov 12 16:00:03 2014 UTC (9 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.12: +3 -3 lines
Diff to previous 1.12 (colored)

Don't let force-width or force-height be < PANE_MINIMUM.

Revision 1.12 / (download) - annotate - [select for diffs], Mon Mar 31 21:37:55 2014 UTC (10 years, 1 month ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.11: +3 -1 lines
Diff to previous 1.11 (colored)

Make session_attached a count and add session_many_attached flag.

Revision 1.11 / (download) - annotate - [select for diffs], Thu Oct 10 11:46:00 2013 UTC (10 years, 7 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.10: +2 -2 lines
Diff to previous 1.10 (colored)

Make recalculate_sizes() handle an empty window with no active
pane. This can happen when a window is in two sessions - it isn't
destroyed immediately when the pane goes away but is left until the last
session is destroyed. Fixes problems with grouped sessions reported by
Daniel Ralston.

Revision 1.10 / (download) - annotate - [select for diffs], Sun Mar 24 09:57:59 2013 UTC (11 years, 1 month ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.9: +7 -3 lines
Diff to previous 1.9 (colored)

Add resize-pane -Z to temporary zoom the active pane to occupy the full
window or unzoom (restored to the normal layout) if it already zoomed,
bound to C-b z by default. The pane is unzoomed on pretty much any
excuse whatsoever.

We considered making this a new layout but the requirements are quite
different from layouts so decided it is better as a special case. Each
current layout cell is saved, a temporary one-cell layout generated and
all except the active pane set to NULL.

Prompted by suggestions and scripts from several. Thanks to Aaron Jensen
and Thiago Padilha for testing an earlier version.

Revision 1.9 / (download) - annotate - [select for diffs], Thu Mar 21 18:46:12 2013 UTC (11 years, 2 months ago) by nicm
Branch: MAIN
Changes since 1.8: +17 -14 lines
Diff to previous 1.8 (colored)

Do not include status line in size calculations in control mode.

Revision 1.8 / (download) - annotate - [select for diffs], Sat Mar 17 22:35:09 2012 UTC (12 years, 2 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2
Changes since 1.7: +2 -1 lines
Diff to previous 1.7 (colored)

Add notify hooks for various events, the functions are currently empty
stubs but will be filled in for control mode later. From George Nachman.

Revision 1.7 / (download) - annotate - [select for diffs], Tue Dec 21 22:37:59 2010 UTC (13 years, 5 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0, OPENBSD_4_9_BASE, OPENBSD_4_9
Changes since 1.6: +4 -9 lines
Diff to previous 1.6 (colored)

Store sessions in an RB tree by name rather than a list, this is tidier
and allows them to easily be shown sorted in various lists
(list-sessions/choose-sessions).

Keep a session index which is used in a couple of places internally but
make it an ever-increasing number rather than filling in gaps with new
sessions.

Revision 1.6 / (download) - annotate - [select for diffs], Mon Nov 22 21:13:13 2010 UTC (13 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.5: +2 -5 lines
Diff to previous 1.5 (colored)

There is somewhere that WINDOW_HIDDEN is getting set when it shouldn't
be and I can't find it, but the flag itself is a useless optimisation
that only applies to automatic-resize windows, so just dispose of it
entirely.

Fixes problems reported by Nicholas Riley.

Revision 1.5 / (download) - annotate - [select for diffs], Mon Jun 21 01:27:46 2010 UTC (13 years, 11 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.4: +2 -2 lines
Diff to previous 1.4 (colored)

Having a list of winlinks->alerts for each session is stupid, just store
the alert flags directly in the winlink itself.

Revision 1.4 / (download) - annotate - [select for diffs], Thu Sep 24 07:02:56 2009 UTC (14 years, 7 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.3: +2 -2 lines
Diff to previous 1.3 (colored)

Don't allow locked or suspended clients to limit the size of active clients.

Revision 1.3 / (download) - annotate - [select for diffs], Sun Jul 19 13:21:40 2009 UTC (14 years, 10 months ago) by nicm
Branch: MAIN
Changes since 1.2: +2 -2 lines
Diff to previous 1.2 (colored)

Improved layout code.

Each window now has a tree of layout cells associated with it. In this tree,
each node is either a horizontal or vertical cell containing a list of other
cells running from left-to-right or top-to-bottom, or a leaf cell which is
associated with a pane.

The major functional changes are:

- panes may now be split arbitrarily both horizontally (splitw -h, C-b %) and
  vertically (splitw -v, C-b ");
- panes may be resized both horizontally and vertically (resizep -L/-R/-U/-D,
  bound to C-b left/right/up/down and C-b M-left/right/up/down);
- layouts are now applied and then may be modified by resizing or splitting
  panes, rather than being fixed and reapplied when the window is resized or
  panes are added;
- manual-vertical layout is no longer necessary, and active-only layout is gone
  (but may return in future);
- the main-pane layouts now reduce the size of the main pane to fit all panes
  if possible.

Thanks to all who tested.

Revision 1.2 / (download) - annotate - [select for diffs], Tue Jul 14 07:23:36 2009 UTC (14 years, 10 months ago) by nicm
Branch: MAIN
Changes since 1.1: +16 -1 lines
Diff to previous 1.1 (colored)

Get rid of the PANE_HIDDEN flag in favour of a function, and moving the
decision for whether or not a pane should be drawn out of the layout code and
into the redraw code.

This is needed for the new layout design, getting it in now to make that easier
to work on.

Revision 1.1 / (download) - annotate - [select for diffs], Mon Jun 1 22:58:49 2009 UTC (14 years, 11 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6

Import tmux, a terminal multiplexor allowing (among other things) a single
terminal to be switched between several different windows and programs
displayed on one terminal be detached from one terminal and moved to another.

ok deraadt pirofti

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.