Try this please, sorry for the attachment but mutt and gmail are not
playing nicely together for me at the moment.
Because the cells created for a layout set are completely new, they don't
have either a width or height. The new spread out code sets one dimension
(in this case, the width) but not the other. We can just fix this by
starting both dimensions out as the full window size - the spread out code
will fix one of them, and we know the full size is right for the other.
On 30 December 2017 at 14:53, Anton Lindqvist <[email protected]> wrote:
> On Fri, Dec 08, 2017 at 10:24:32AM +0100, Andreas Kusalananda Kähäri wrote:
> > Hi,
> >
> > Bug: When splitting a tmux pane with <prefix>-<">, under some
> > circumstances, the new pane will not be half the size of the original
> > pane but rather as big as possible, leaving only a single line for the
> > original pane at the top.
> >
> > To reproduce: Start tmux, split the initial pane in two with
> > <prefix>-<"> and change the layout to two side-by-side panes with
> > <prefix>-<space>. Then split one of the new panes vertically with
> > <prefix>-<"> or "tmux split".
> >
> > This does not seem to happen if the layout isn't first changed with
> > <prefix>-<space>, and it only seems to happen if there are only
> > side-by-side panes (no top/bottom split).
> >
> > I *think* this was introduced during November. The bug is present in
> > -current as of this morning.
> >
> > I've reproduced it over SSH from both PyTTY on Windows and iTerm on
> > macOS, as well as while logged in on the physical machine in xterm and
> > in the console (with no X-Windows running).
> >
> > Sometimes, too, when connecting to an existing tmux session, the session
> > will immediately exit (the tmux server dies), or the lower part of the
> > tmux window will be unused (the panes are restricted to the upper half),
> > even if no smaller client is connected to the tmux server at the time.
> > This too started happening around the same time but I can't reproduce it
> > reliably.
> >
> > My tmux configuration is
> >
> > set-option -g history-limit 5000
> > set-option -g mouse on
> > set-option -g prefix C-a
> > set-option escape-time 100
> >
> > set-window-option -g allow-rename off
> > set-window-option -g automatic-rename off
> >
> > bind-key C-a send-prefix
> > unbind-key C-b
> >
> > TERM is "screen" in the tmux session.
>
> I was able to bisect down the commit[1][2] that introduced this regression
> with the following revisions:
>
> - cmd-select-layout.c 1.34
> - key-bindings.c 1.84
> - layout-set.c 1.19
> - layout.c 1.33
>
> [1] https://github.com/tmux/tmux/commit/3b649d2
> [2] https://github.com/openbsd/src/commit/967ee5b9658
>
diff --git a/layout-set.c b/layout-set.c
index 0f01cbcc..5055f672 100644
--- a/layout-set.c
+++ b/layout-set.c
@@ -138,6 +138,8 @@ layout_set_even(struct window *w, enum layout_type type)
TAILQ_FOREACH(wp, &w->panes, entry) {
lcnew = layout_create_cell(lc);
layout_make_leaf(lcnew, wp);
+ lcnew->sx = w->sx;
+ lcnew->sy = w->sy;
TAILQ_INSERT_TAIL(&lc->cells, lcnew, entry);
}