tmux sometimes splits panes non-evenly

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

tmux sometimes splits panes non-evenly

Andreas Kusalananda Kähäri
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.


--
Andreas Kusalananda Kähäri,
National Bioinformatics Infrastructure Sweden (NBIS),
Uppsala University, Sweden.

Reply | Threaded
Open this post in threaded view
|

Re: tmux sometimes splits panes non-evenly

Anton Lindqvist-2
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

Reply | Threaded
Open this post in threaded view
|

Re: tmux sometimes splits panes non-evenly

Nicholas Marriott-2
Hi Anton, how do you reproduce this? How many panes in what layout, what
commands in what order, etc.

On 30 December 2017 at 14:53, Anton Lindqvist <[hidden email]> 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
>
Reply | Threaded
Open this post in threaded view
|

Re: tmux sometimes splits panes non-evenly

Nicholas Marriott-2
Never mind, I see the instructions now, let me have a go.

On 31 December 2017 at 12:20, Nicholas Marriott <[hidden email]
> wrote:

> Hi Anton, how do you reproduce this? How many panes in what layout, what
> commands in what order, etc.
>
> On 30 December 2017 at 14:53, Anton Lindqvist <[hidden email]> 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
>>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: tmux sometimes splits panes non-evenly

Nicholas Marriott-2
In reply to this post by Anton Lindqvist-2
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 <[hidden email]> 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
>

x.diff.txt (542 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: tmux sometimes splits panes non-evenly

Anton Lindqvist-2
On Sun, Dec 31, 2017 at 12:51:56PM +0000, Nicholas Marriott wrote:
> 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.

Thanks, works over here.