OpenBSD CVS

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


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.48 / (download) - annotate - [select for diffs], Thu Mar 11 06:31:05 2021 UTC (3 years, 2 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, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, HEAD
Changes since 1.47: +14 -10 lines
Diff to previous 1.47 (colored)

Add split-window -Z to start the pane zoomed, GitHub issue 2591.

Revision 1.47 / (download) - annotate - [select for diffs], Mon Jul 15 18:43:32 2019 UTC (4 years, 10 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.46: +65 -42 lines
Diff to previous 1.46 (colored)

Simplify code to work out if an extra line is needed in the cell.

Revision 1.46 / (download) - annotate - [select for diffs], Mon Jul 15 18:25:07 2019 UTC (4 years, 10 months ago) by nicm
Branch: MAIN
Changes since 1.45: +22 -10 lines
Diff to previous 1.45 (colored)

Make layout_fix_offsets take a window like layout_fix_panes.

Revision 1.45 / (download) - annotate - [select for diffs], Wed Jun 26 18:44:22 2019 UTC (4 years, 10 months ago) by nicm
Branch: MAIN
Changes since 1.44: +3 -3 lines
Diff to previous 1.44 (colored)

Fix a typo in window_pane_find_down (w not wp) and a missing PANE_STATUS_TOP.

Revision 1.44 / (download) - annotate - [select for diffs], Wed Jun 26 13:03:47 2019 UTC (4 years, 10 months ago) by nicm
Branch: MAIN
Changes since 1.43: +19 -19 lines
Diff to previous 1.43 (colored)

Add #define for the pane status line option position numbers.

Revision 1.43 / (download) - annotate - [select for diffs], Tue Apr 23 09:15:24 2019 UTC (5 years ago) by nicm
Branch: MAIN
Changes since 1.42: +3 -3 lines
Diff to previous 1.42 (colored)

Do not try to resize if the parent cell is NULL, problem reported by
Sunil Nimmagadda.

Revision 1.42 / (download) - annotate - [select for diffs], Wed Apr 17 14:44:33 2019 UTC (5 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.41: +23 -9 lines
Diff to previous 1.41 (colored)

Fix minimum size check on split and size of first cell on spread out
with a pane status line.

Revision 1.41 / (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.40: +3 -3 lines
Diff to previous 1.40 (colored)

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

Revision 1.40 / (download) - annotate - [select for diffs], Wed Apr 17 14:37:48 2019 UTC (5 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.39: +9 -8 lines
Diff to previous 1.39 (colored)

Break new window and pane creation common code from various commands and
window.c into a separate file spawn.c.

Revision 1.39 / (download) - annotate - [select for diffs], Thu Apr 4 10:25:35 2019 UTC (5 years, 1 month ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.38: +14 -7 lines
Diff to previous 1.38 (colored)

Fix size check for splitw -f and top level pane size for tiled layout,
problems reported by Thomas Sattler.

Revision 1.38 / (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.37: +12 -55 lines
Diff to previous 1.37 (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.37 / (download) - annotate - [select for diffs], Mon Sep 24 15:29:56 2018 UTC (5 years, 7 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.36: +6 -5 lines
Diff to previous 1.36 (colored)

Only include pane status in minimum size if it is turned on, GitHub
issue 1480.

Revision 1.36 / (download) - annotate - [select for diffs], Fri Jun 8 20:54:22 2018 UTC (5 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.35: +66 -23 lines
Diff to previous 1.35 (colored)

Instead of working out which pane to resize with the mouse by walking
the panes list, look through the layout cells for the nearest border and
resize that cell. From Dan Aloni in GitHub issue 1374.

Revision 1.35 / (download) - annotate - [select for diffs], Fri Mar 23 07:44:44 2018 UTC (6 years, 1 month ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3
Changes since 1.34: +2 -2 lines
Diff to previous 1.34 (colored)

Fix size calculation when spreading out panes.

Revision 1.34 / (download) - annotate - [select for diffs], Fri Jan 12 10:16:03 2018 UTC (6 years, 4 months ago) by nicm
Branch: MAIN
Changes since 1.33: +18 -3 lines
Diff to previous 1.33 (colored)

Improve logging for layout cells.

Revision 1.33 / (download) - annotate - [select for diffs], Wed Nov 15 19:59:27 2017 UTC (6 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.32: +59 -1 lines
Diff to previous 1.32 (colored)

Add a common function for spreading out cells and use it for the two
even layouts and to add a -E flag to select-layout to spread out cells
evenly without changing parent cells.

Revision 1.32 / (download) - annotate - [select for diffs], Sat Mar 11 15:16:35 2017 UTC (7 years, 2 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.31: +4 -3 lines
Diff to previous 1.31 (colored)

Fix calculation of size for full size splits.

Revision 1.31 / (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.30: +3 -3 lines
Diff to previous 1.30 (colored)

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

Revision 1.30 / (download) - annotate - [select for diffs], Mon Oct 10 17:28:30 2016 UTC (7 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.29: +12 -10 lines
Diff to previous 1.29 (colored)

Do not allow the opposite pane to resize when dragging with the mouse
because it is not possible to keep the mouse on the border when the
minimum size is reached.

Revision 1.29 / (download) - annotate - [select for diffs], Sun Sep 4 17:37:06 2016 UTC (7 years, 8 months ago) by nicm
Branch: MAIN
Changes since 1.28: +233 -44 lines
Diff to previous 1.28 (colored)

Add support for performing a full width split (with splitw -f), rather
than splitting the current cell. From Stephen Kent.

Revision 1.28 / (download) - annotate - [select for diffs], Wed Aug 3 09:07:02 2016 UTC (7 years, 9 months ago) by nicm
Branch: MAIN
Changes since 1.27: +56 -44 lines
Diff to previous 1.27 (colored)

Fix minimum size when pane status line is enabled, reported by Y Petremann.

Revision 1.27 / (download) - annotate - [select for diffs], Fri Apr 29 15:00:48 2016 UTC (8 years ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0
Changes since 1.26: +47 -5 lines
Diff to previous 1.26 (colored)

Add option to include status text in the pane borders. If
pane-border-status is set to "top" or "bottom" (rather than "off"),
every pane has a permanent top or bottom border containing the text from
pane-border-format.

Based on a diff sent long ago by Jonathan Slenders, mostly rewritten and
simplified by me.

Revision 1.26 / (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_5_9_BASE, OPENBSD_5_9
Changes since 1.25: +2 -2 lines
Diff to previous 1.25 (colored)

I no longer use my SourceForge address so replace it.

Revision 1.25 / (download) - annotate - [select for diffs], Fri Dec 11 16:37:21 2015 UTC (8 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.24: +12 -12 lines
Diff to previous 1.24 (colored)

Style nits and line wrapping of function declarations.

Revision 1.24 / (download) - annotate - [select for diffs], Fri Sep 18 09:55:22 2015 UTC (8 years, 8 months ago) by nicm
Branch: MAIN
Changes since 1.23: +5 -1 lines
Diff to previous 1.23 (colored)

-l should apply to the new not the old pane with -b, from "MadMaverick9"
on GitHub.

Revision 1.23 / (download) - annotate - [select for diffs], Sun Apr 19 21:34:21 2015 UTC (9 years, 1 month ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.22: +1 -53 lines
Diff to previous 1.22 (colored)

Rewrite of tmux mouse support which was a mess. Instead of having
options for "mouse-this" and "mouse-that", mouse events may be bound as
keys and there is one option "mouse" that turns on mouse support
entirely (set -g mouse on).

See the new MOUSE SUPPORT section of the man page for description of the
key names and new flags (-t= to specify the pane or window under mouse
as a target, and send-keys -M to pass through a mouse event).

The default builtin bindings for the mouse are:

    bind -n   MouseDown1Pane select-pane -t=; send-keys -M
    bind -n MouseDown1Status select-window -t=
    bind -n   MouseDrag1Pane copy-mode -M
    bind -n MouseDrag1Border resize-pane -M

To get the effect of turning mode-mouse off, do:

    unbind -n MouseDrag1Pane
    unbind -temacs-copy MouseDrag1Pane

The old mouse options are now gone, set-option -q may be used to
suppress warnings if mixing configuration files.

Revision 1.22 / (download) - annotate - [select for diffs], Thu May 8 06:03:30 2014 UTC (10 years ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7, OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.21: +1 -2 lines
Diff to previous 1.21 (colored)

Both the two previous ways of navigating panes by direction have
irritating flaws:

a) The old way of always using the top or left if the choice is
ambiguous is annoying when the layout is unbalanced.

b) The new way of remembering the last used pane is annoying if the
layout is balanced and the leftmost is obvious to the user (because
clearly if we go right from the top-left in a tiled set of four we want
to end up in top-right, even if we were last using the bottom-right).

So instead, use a combination of both: if there is only one possible
pane alongside the current pane, move to it, otherwise choose the most
recently used of the choice.

Revision 1.21 / (download) - annotate - [select for diffs], Sat Feb 22 18:01:10 2014 UTC (10 years, 2 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.20: +2 -1 lines
Diff to previous 1.20 (colored)

Fix crash due to uninitialized lastwp member of layout_cell, reported by
Balazs Kezes.

Revision 1.20 / (download) - annotate - [select for diffs], Thu Oct 10 12:08:14 2013 UTC (10 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.19: +2 -2 lines
Diff to previous 1.19 (colored)

mouse-resize-pane: Only resize on border select

The current behaviour of mouse-resize-pane is such that if the mouse
button is held down and a selection takes place within a pane, that if
the mouse pointer then hits a border edge, that pane-resize would
initiate.

This seems counter-intuitive; instead, check for a resize condition if
the border of a pane is selected, and in the case of mouse selection
within a pane, no longer resize the pane if edge of the border is hit.

By Thomas Adam.

Revision 1.19 / (download) - annotate - [select for diffs], Thu Oct 10 12:03:46 2013 UTC (10 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.18: +4 -1 lines
Diff to previous 1.18 (colored)

layout-resize-pane-mouse: Consider visible panes only

When a pane is maximized, and text is selected, we end up checking if a
pane switch is needed.  This therefore means we might end up selecting
panes which aren't visible.

By Thomas Adam.

Revision 1.18 / (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.17: +3 -3 lines
Diff to previous 1.17 (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.17 / (download) - annotate - [select for diffs], Fri Mar 22 10:37:39 2013 UTC (11 years, 2 months ago) by nicm
Branch: MAIN
Changes since 1.16: +37 -1 lines
Diff to previous 1.16 (colored)

Add resize-pane -x and -y for absolute pane size (much requested).

Revision 1.16 / (download) - annotate - [select for diffs], Thu Jan 17 00:11:22 2013 UTC (11 years, 4 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.15: +1 -73 lines
Diff to previous 1.15 (colored)

Remove the layout undo/redo code which never really worked.

Revision 1.15 / (download) - annotate - [select for diffs], Fri Oct 26 14:35:42 2012 UTC (11 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.14: +22 -21 lines
Diff to previous 1.14 (colored)

Make mouse event structure clearer by defining events (up, click, drag)
and simplifying how buttons and wheels are represented, from Ailin
Nemui. Should be no functional changes.

Revision 1.14 / (download) - annotate - [select for diffs], Tue Jul 10 11:53:01 2012 UTC (11 years, 10 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_2_BASE, OPENBSD_5_2
Changes since 1.13: +4 -4 lines
Diff to previous 1.13 (colored)

xfree is not particularly helpful, remove it. From Thomas Adam.

Revision 1.13 / (download) - annotate - [select for diffs], Sun Apr 1 21:07:35 2012 UTC (12 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.12: +12 -12 lines
Diff to previous 1.12 (colored)

Fix some indentation.

Revision 1.12 / (download) - annotate - [select for diffs], Sun Apr 1 13:21:38 2012 UTC (12 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.11: +2 -2 lines
Diff to previous 1.11 (colored)

Fix option name.

Revision 1.11 / (download) - annotate - [select for diffs], Sun Apr 1 13:18:38 2012 UTC (12 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.10: +73 -1 lines
Diff to previous 1.10 (colored)

Add a layout history which can be stepped through with select-layout -u
and -U commands (bound to 'u' and 'U' by default).

Revision 1.10 / (download) - annotate - [select for diffs], Sat Mar 17 22:35:09 2012 UTC (12 years, 2 months ago) by nicm
Branch: MAIN
Changes since 1.9: +3 -1 lines
Diff to previous 1.9 (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.9 / (download) - annotate - [select for diffs], Sat Mar 3 08:31:18 2012 UTC (12 years, 2 months ago) by nicm
Branch: MAIN
Changes since 1.8: +25 -10 lines
Diff to previous 1.8 (colored)

Add move-pane command (like join-pane but allows the same window). Also
-b flag to join-pane and move-pane to place the pane to the left or
above. From George Nachman.

Revision 1.8 / (download) - annotate - [select for diffs], Sun Jan 29 09:37:02 2012 UTC (12 years, 3 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_1_BASE, OPENBSD_5_1
Changes since 1.7: +3 -3 lines
Diff to previous 1.7 (colored)

Add an option to move the status line to the top of the screen,
requested by many.

Revision 1.7 / (download) - annotate - [select for diffs], Sun May 8 20:34:12 2011 UTC (13 years ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.6: +48 -1 lines
Diff to previous 1.6 (colored)

Add a new option, mouse-resize-pane. When on, panes may be resized by
dragging their borders. From hsim at gmx.li.

Revision 1.6 / (download) - annotate - [select for diffs], Tue Jun 29 03:30:14 2010 UTC (13 years, 10 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.5: +79 -51 lines
Diff to previous 1.5 (colored)

Custom layouts. list-windows command displays the layout as a string (such as
"bb62,159x48,0,0{79x48,0,0,79x48,80,0}") and it can be applied to another
window (with the same number of panes or fewer) using select-layout.

Revision 1.5 / (download) - annotate - [select for diffs], Thu Jan 7 20:52:18 2010 UTC (14 years, 4 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.4: +18 -12 lines
Diff to previous 1.4 (colored)

New command, join-pane, to split and move an existing pane into the space (like
splitw then movep, or the reverse of breakp).

Revision 1.4 / (download) - annotate - [select for diffs], Thu Dec 3 22:50:10 2009 UTC (14 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.3: +24 -24 lines
Diff to previous 1.3 (colored)

Massive spaces->tabs and trailing whitespace cleanup, hopefully for the last
time now I've configured emacs to make them displayed in really annoying
colours...

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: +531 -248 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: +30 -37 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.