NetBSD Problem Report #53564

From cspencer@gmail.com  Fri Aug 31 18:19:34 2018
Return-Path: <cspencer@gmail.com>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id C99467A186
	for <gnats-bugs@gnats.NetBSD.org>; Fri, 31 Aug 2018 18:19:33 +0000 (UTC)
Message-Id: <20180831170447.E3F87A99DC@masavana.p>
Date: Fri, 31 Aug 2018 13:04:47 -0400 (EDT)
From: cspencer@gmail.com
Reply-To: cspencer@gmail.com
To: gnats-bugs@NetBSD.org
Subject: tmux: pagination/wordwrap misalingment
X-Send-Pr-Version: 3.95

>Number:         53564
>Category:       misc
>Synopsis:       tmux: pagination/wordwrap misalingment
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    misc-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Aug 31 18:20:00 +0000 2018
>Last-Modified:  Mon Sep 03 12:15:01 +0000 2018
>Originator:     Courtney Spencer
>Release:        NetBSD 8.0_RC2
>Organization:
>Environment:
System: NetBSD masavana.p 8.0_RC2 NetBSD 8.0_RC2 (GENERIC) #0: Mon Jun 25 13:01:26 UTC 2018 mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/i386/compile/GENERIC i386
Architecture: i386
Machine: i386
>Description:
        On a default install, regardles of shell or TERM, tmux
when reading long lines, writes the output to the terminal
by breaking up then entire string insets of two line breaks with an
unread, but added line break. 

>How-To-Repeat:
In 8.x, start a tmux session.

Write a one-line string to the terminal such that the number of 
characters is greater than
2 * $COLUMNS + 1:

For purposes of demonstration, I'm using 480 characters written to an
80 column terminal.

jot -s "" -b L 480

Double click to select the output, or click and drag to select.
When double-clicking, the highlited area will be exactly two lines
regardless of how long the string is and how much it wraps.
When highlighting and draging, write the selction to a temp
file and notice there are multiple lines.  In my example above
480 characters becomes 3 lines.
>Fix:


>Audit-Trail:
From: Leonardo Taccari <leot@NetBSD.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: misc/53564: tmux: pagination/wordwrap misalingment
Date: Sat, 01 Sep 2018 16:56:36 +0200

 Hello Courtney, =


 cspencer@gmail.com writes:
 > >Number:         53564
 > >Category:       misc
 > >Synopsis:       tmux: pagination/wordwrap misalingment
 > >Confidential:   no
 > >Severity:       non-critical
 > >Priority:       medium
 > >Responsible:    misc-bug-people
 > >State:          open
 > >Class:          sw-bug
 > >Submitter-Id:   net
 > >Arrival-Date:   Fri Aug 31 18:20:00 +0000 2018
 > >Originator:     Courtney Spencer
 > >Release:        NetBSD 8.0_RC2
 > >Organization:
 > >Environment:
 > [...]
 > >Description:
 >         On a default install, regardles of shell or TERM, tmux
 > when reading long lines, writes the output to the terminal
 > by breaking up then entire string insets of two line breaks with an
 > unread, but added line break. =

 >
 > >How-To-Repeat:
 > In 8.x, start a tmux session.
 >
 > Write a one-line string to the terminal such that the number of =

 > characters is greater than
 > 2 * $COLUMNS + 1:
 >
 > For purposes of demonstration, I'm using 480 characters written to an
 > 80 column terminal.
 >
 > jot -s "" -b L 480
 >
 > Double click to select the output, or click and drag to select.
 > When double-clicking, the highlited area will be exactly two lines
 > regardless of how long the string is and how much it wraps.
 > When highlighting and draging, write the selction to a temp
 > file and notice there are multiple lines.  In my example above
 > 480 characters becomes 3 lines.

 I have tested with tmux-2.4^[0] on NetBSD-current and I can reproduce
 the problem you have described... But, good news!, it seems that
 it was fixed upstream (fix contained in tmux-2.5) by the following
 commit:

  <https://github.com/tmux/tmux/commit/d520dae6ac9acf980d48fbc8307ac83a5cee=
 2938>

 ...and the corresponding diff:

  <https://github.com/tmux/tmux/commit/d520dae6ac9acf980d48fbc8307ac83a5cee=
 2938.diff>

 applies cleanly.

 Please let us know if applying the diff fixes the problem!


 (Surely this is pretty annoying for copy and paste but I'm not sure
 if it's worth to be pulled up to netbsd-8 or not, releng?)


 PS: As a workaround, if it is less intrusive, you can also install the
     tmux pkgsrc package that should not be affected by this problem.


 [0]: AFAIK tmux-2.4 in NetBSD 8.0 should not differ significantly,
      except for not using configure.

From: "Courtney R. Spencer" <cspencer@gmail.com>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: misc/53564: tmux: pagination/wordwrap misalingment
Date: Sat, 1 Sep 2018 22:07:07 -0400

 --00000000000083fe150574d9e279
 Content-Type: text/plain; charset="UTF-8"

 On Sat, Sep 1, 2018 at 11:00 AM Leonardo Taccari <leot@netbsd.org> wrote:

 > The following reply was made to PR misc/53564; it has been noted by GNATS.
 >
 > From: Leonardo Taccari <leot@NetBSD.org>
 > To: gnats-bugs@NetBSD.org
 > Cc:
 > Subject: Re: misc/53564: tmux: pagination/wordwrap misalingment
 > Date: Sat, 01 Sep 2018 16:56:36 +0200
 >
 >  Hello Courtney, =
 >
 >
 >  cspencer@gmail.com writes:
 >  > >Number:         53564
 >  > >Category:       misc
 >  > >Synopsis:       tmux: pagination/wordwrap misalingment
 >  > >Confidential:   no
 >  > >Severity:       non-critical
 >  > >Priority:       medium
 >  > >Responsible:    misc-bug-people
 >  > >State:          open
 >  > >Class:          sw-bug
 >  > >Submitter-Id:   net
 >  > >Arrival-Date:   Fri Aug 31 18:20:00 +0000 2018
 >  > >Originator:     Courtney Spencer
 >  > >Release:        NetBSD 8.0_RC2
 >  > >Organization:
 >  > >Environment:
 >  > [...]
 >  > >Description:
 >  >         On a default install, regardles of shell or TERM, tmux
 >  > when reading long lines, writes the output to the terminal
 >  > by breaking up then entire string insets of two line breaks with an
 >  > unread, but added line break. =
 >
 >  >
 >  > >How-To-Repeat:
 >  > In 8.x, start a tmux session.
 >  >
 >  > Write a one-line string to the terminal such that the number of =
 >
 >  > characters is greater than
 >  > 2 * $COLUMNS + 1:
 >  >
 >  > For purposes of demonstration, I'm using 480 characters written to an
 >  > 80 column terminal.
 >  >
 >  > jot -s "" -b L 480
 >  >
 >  > Double click to select the output, or click and drag to select.
 >  > When double-clicking, the highlited area will be exactly two lines
 >  > regardless of how long the string is and how much it wraps.
 >  > When highlighting and draging, write the selction to a temp
 >  > file and notice there are multiple lines.  In my example above
 >  > 480 characters becomes 3 lines.
 >
 >  I have tested with tmux-2.4^[0] on NetBSD-current and I can reproduce
 >  the problem you have described... But, good news!, it seems that
 >  it was fixed upstream (fix contained in tmux-2.5) by the following
 >  commit:
 >
 >   <
 > https://github.com/tmux/tmux/commit/d520dae6ac9acf980d48fbc8307ac83a5cee=
 >  2938>
 >
 >  ...and the corresponding diff:
 >
 >   <
 > https://github.com/tmux/tmux/commit/d520dae6ac9acf980d48fbc8307ac83a5cee=
 >  2938.diff>
 >
 >  applies cleanly.
 >
 >  Please let us know if applying the diff fixes the problem!
 >
 >
 >  (Surely this is pretty annoying for copy and paste but I'm not sure
 >  if it's worth to be pulled up to netbsd-8 or not, releng?)
 >
 >
 >  PS: As a workaround, if it is less intrusive, you can also install the
 >      tmux pkgsrc package that should not be affected by this problem.
 >
 >
 >  [0]: AFAIK tmux-2.4 in NetBSD 8.0 should not differ significantly,
 >       except for not using configure.
 >
 >
 Thanks for looking into.
 But tmux 2.4 in 8.0 base and pkgsrc tmux 2.6 exhibit the same behavior
 on my 8.0 system...

 This was not the case of base tmux 2.4 in 7.1.1.  I noticed the change in
 behavior
 almost immediately after upgrading with the base tmux.  I've tried building
 pkgsrc tmux 2.6 with system curses and ncurses; I've tried importing 7.1
 screen.terminfo as well before having any info.

 Regards,
 Courtney

 --00000000000083fe150574d9e279
 Content-Type: text/html; charset="UTF-8"
 Content-Transfer-Encoding: quoted-printable

 <div dir=3D"ltr"><br><br><div class=3D"gmail_quote"><div dir=3D"ltr">On Sat=
 , Sep 1, 2018 at 11:00 AM Leonardo Taccari &lt;<a href=3D"mailto:leot@netbs=
 d.org">leot@netbsd.org</a>&gt; wrote:<br></div><blockquote class=3D"gmail_q=
 uote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1e=
 x">The following reply was made to PR misc/53564; it has been noted by GNAT=
 S.<br>
 <br>
 From: Leonardo Taccari &lt;leot@NetBSD.org&gt;<br>
 To: gnats-bugs@NetBSD.org<br>
 Cc: <br>
 Subject: Re: misc/53564: tmux: pagination/wordwrap misalingment<br>
 Date: Sat, 01 Sep 2018 16:56:36 +0200<br>
 <br>
 =C2=A0Hello Courtney, =3D<br>
 <br>
 <br>
 =C2=A0<a href=3D"mailto:cspencer@gmail.com" target=3D"_blank">cspencer@gmai=
 l.com</a> writes:<br>
 =C2=A0&gt; &gt;Number:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A053564<br>
 =C2=A0&gt; &gt;Category:=C2=A0 =C2=A0 =C2=A0 =C2=A0misc<br>
 =C2=A0&gt; &gt;Synopsis:=C2=A0 =C2=A0 =C2=A0 =C2=A0tmux: pagination/wordwra=
 p misalingment<br>
 =C2=A0&gt; &gt;Confidential:=C2=A0 =C2=A0no<br>
 =C2=A0&gt; &gt;Severity:=C2=A0 =C2=A0 =C2=A0 =C2=A0non-critical<br>
 =C2=A0&gt; &gt;Priority:=C2=A0 =C2=A0 =C2=A0 =C2=A0medium<br>
 =C2=A0&gt; &gt;Responsible:=C2=A0 =C2=A0 misc-bug-people<br>
 =C2=A0&gt; &gt;State:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 open<br>
 =C2=A0&gt; &gt;Class:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 sw-bug<br>
 =C2=A0&gt; &gt;Submitter-Id:=C2=A0 =C2=A0net<br>
 =C2=A0&gt; &gt;Arrival-Date:=C2=A0 =C2=A0Fri Aug 31 18:20:00 +0000 2018<br>
 =C2=A0&gt; &gt;Originator:=C2=A0 =C2=A0 =C2=A0Courtney Spencer<br>
 =C2=A0&gt; &gt;Release:=C2=A0 =C2=A0 =C2=A0 =C2=A0 NetBSD 8.0_RC2<br>
 =C2=A0&gt; &gt;Organization:<br>
 =C2=A0&gt; &gt;Environment:<br>
 =C2=A0&gt; [...]<br>
 =C2=A0&gt; &gt;Description:<br>
 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0On a default install, regardles=
  of shell or TERM, tmux<br>
 =C2=A0&gt; when reading long lines, writes the output to the terminal<br>
 =C2=A0&gt; by breaking up then entire string insets of two line breaks with=
  an<br>
 =C2=A0&gt; unread, but added line break. =3D<br>
 <br>
 =C2=A0&gt;<br>
 =C2=A0&gt; &gt;How-To-Repeat:<br>
 =C2=A0&gt; In 8.x, start a tmux session.<br>
 =C2=A0&gt;<br>
 =C2=A0&gt; Write a one-line string to the terminal such that the number of =
 =3D<br>
 <br>
 =C2=A0&gt; characters is greater than<br>
 =C2=A0&gt; 2 * $COLUMNS + 1:<br>
 =C2=A0&gt;<br>
 =C2=A0&gt; For purposes of demonstration, I&#39;m using 480 characters writ=
 ten to an<br>
 =C2=A0&gt; 80 column terminal.<br>
 =C2=A0&gt;<br>
 =C2=A0&gt; jot -s &quot;&quot; -b L 480<br>
 =C2=A0&gt;<br>
 =C2=A0&gt; Double click to select the output, or click and drag to select.<=
 br>
 =C2=A0&gt; When double-clicking, the highlited area will be exactly two lin=
 es<br>
 =C2=A0&gt; regardless of how long the string is and how much it wraps.<br>
 =C2=A0&gt; When highlighting and draging, write the selction to a temp<br>
 =C2=A0&gt; file and notice there are multiple lines.=C2=A0 In my example ab=
 ove<br>
 =C2=A0&gt; 480 characters becomes 3 lines.<br>
 <br>
 =C2=A0I have tested with tmux-2.4^[0] on NetBSD-current and I can reproduce=
 <br>
 =C2=A0the problem you have described... But, good news!, it seems that<br>
 =C2=A0it was fixed upstream (fix contained in tmux-2.5) by the following<br=
 >
 =C2=A0commit:<br>
 <br>
 =C2=A0 &lt;<a href=3D"https://github.com/tmux/tmux/commit/d520dae6ac9acf980=
 d48fbc8307ac83a5cee=3D" rel=3D"noreferrer" target=3D"_blank">https://github=
 .com/tmux/tmux/commit/d520dae6ac9acf980d48fbc8307ac83a5cee=3D</a><br>
 =C2=A02938&gt;<br>
 <br>
 =C2=A0...and the corresponding diff:<br>
 <br>
 =C2=A0 &lt;<a href=3D"https://github.com/tmux/tmux/commit/d520dae6ac9acf980=
 d48fbc8307ac83a5cee=3D" rel=3D"noreferrer" target=3D"_blank">https://github=
 .com/tmux/tmux/commit/d520dae6ac9acf980d48fbc8307ac83a5cee=3D</a><br>
 =C2=A02938.diff&gt;<br>
 <br>
 =C2=A0applies cleanly.<br>
 <br>
 =C2=A0Please let us know if applying the diff fixes the problem!<br>
 <br>
 <br>
 =C2=A0(Surely this is pretty annoying for copy and paste but I&#39;m not su=
 re<br>
 =C2=A0if it&#39;s worth to be pulled up to netbsd-8 or not, releng?)<br>
 <br>
 <br>
 =C2=A0PS: As a workaround, if it is less intrusive, you can also install th=
 e<br>
 =C2=A0 =C2=A0 =C2=A0tmux pkgsrc package that should not be affected by this=
  problem.<br>
 <br>
 <br>
 =C2=A0[0]: AFAIK tmux-2.4 in NetBSD 8.0 should not differ significantly,<br=
 >
 =C2=A0 =C2=A0 =C2=A0 except for not using configure.<br>
 <br></blockquote><div><br></div><div>Thanks for looking into.</div><div>But=
  tmux 2.4 in 8.0 base and pkgsrc tmux 2.6 exhibit the same behavior</div><d=
 iv>on my 8.0 system...</div><div><br></div><div>This was not the case of ba=
 se tmux 2.4 in 7.1.1.=C2=A0 I noticed the change in behavior<br></div><div>=
 almost immediately after upgrading with the base tmux.=C2=A0 I&#39;ve tried=
  building <br></div><div>pkgsrc tmux 2.6 with system curses and ncurses; I&=
 #39;ve tried importing 7.1 <br></div><div>screen.terminfo as well before ha=
 ving any info.</div><div><br></div><div>Regards,</div><div>Courtney<br></di=
 v></div></div>

 --00000000000083fe150574d9e279--

From: "Courtney R. Spencer" <cspencer@gmail.com>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: misc/53564: tmux: pagination/wordwrap misalingment
Date: Sat, 1 Sep 2018 22:53:25 -0400

 On Sat, Sep 1, 2018 at 10:07 PM Courtney R. Spencer <cspencer@gmail.com> wrote:

 > Thanks for looking into.
 > But tmux 2.4 in 8.0 base and pkgsrc tmux 2.6 exhibit the same behavior
 > on my 8.0 system...
 >
 > This was not the case of base tmux 2.4 in 7.1.1.  I noticed the change in behavior
 > almost immediately after upgrading with the base tmux.  I've tried building
 > pkgsrc tmux 2.6 with system curses and ncurses; I've tried importing 7.1
 > screen.terminfo as well before having any info.
 >

 Correction, 7.1.1 had tmux "1.9a" in base which works fine.

 I didn't realize how much I use copy/paste until copying around ssh
 keys with cat(1)
 resulted in some unexpected behavior.  Then I tried copying ps output
 and saw the same
 behavior for long lines.

 But still, I validated tmux 2.6 in pkgsrc has the referenced diff
 applied, and still exhibits the
 same behavior.

 Regards,
 Courtney

From: Leonardo Taccari <leot@NetBSD.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: misc/53564: tmux: pagination/wordwrap misalingment
Date: Sun, 02 Sep 2018 23:15:44 +0200

 Hello Courtney,

 Courtney R. Spencer writes:
 > [...]
 >  On Sat, Sep 1, 2018 at 10:07 PM Courtney R. Spencer <cspencer@gmail.com=
 > wrote:
 >  =

 >  > Thanks for looking into.
 >  > But tmux 2.4 in 8.0 base and pkgsrc tmux 2.6 exhibit the same behavio=
 r
 >  > on my 8.0 system...
 >  >
 >  > This was not the case of base tmux 2.4 in 7.1.1.  I noticed the chang=
 e in behavior
 >  > almost immediately after upgrading with the base tmux.  I've tried bu=
 ilding
 >  > pkgsrc tmux 2.6 with system curses and ncurses; I've tried importing =
 7.1
 >  > screen.terminfo as well before having any info.
 >  >
 >  =

 >  Correction, 7.1.1 had tmux "1.9a" in base which works fine.
 >  =


 Thanks for also checking that and good!

 >  I didn't realize how much I use copy/paste until copying around ssh
 >  keys with cat(1)
 >  resulted in some unexpected behavior.  Then I tried copying ps output
 >  and saw the same
 >  behavior for long lines.
 >  =

 >  But still, I validated tmux 2.6 in pkgsrc has the referenced diff
 >  applied, and still exhibits the
 >  same behavior.
 >  =


 Mmh, probably you have already done that but just to double-check
 that...  Can you please start tmux-2.6 via something like (the `-L'
 will hopefully make a difference):

  % /usr/pkg/bin/tmux -L tmux-2.6

 If `-L' and/or `-S' option is not used and there are tmux sessions
 present I think that the problem can still manifest because the
 server running can be the (problematic) tmux-2.4 one.^[0]

 I hope this will make a difference!... If not, please also share the
 terminal used (xterm or similars).


 Thank you for the quick feedback!


 [0]: Just a side story but I think that I was bitten by that several
      times when trying to patch tmux, spent several minutes why
      the behaviour wasn't changed by the patch and then figured
      out that it was actually not really applied because there was
      an existent session and so the new code was not run! :)

From: "Courtney R. Spencer" <cspencer@gmail.com>
To: gnats-bugs@netbsd.org
Cc: misc-bug-people@netbsd.org, gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: misc/53564: tmux: pagination/wordwrap misalingment
Date: Mon, 3 Sep 2018 08:13:00 -0400

 On Sun, Sep 2, 2018 at 5:20 PM Leonardo Taccari <leot@netbsd.org> wrote:
 >
 > The following reply was made to PR misc/53564; it has been noted by GNATS.
 >
 > From: Leonardo Taccari <leot@NetBSD.org>
 > To: gnats-bugs@NetBSD.org
 > Cc:
 > Subject: Re: misc/53564: tmux: pagination/wordwrap misalingment
 > Date: Sun, 02 Sep 2018 23:15:44 +0200
 >
 >  Hello Courtney,
 >

 >  >  =
 >
 >  >  Correction, 7.1.1 had tmux "1.9a" in base which works fine.
 >  >  =
 >
 >
 >  Thanks for also checking that and good!
 >
 >  >  I didn't realize how much I use copy/paste until copying around ssh
 >  >  keys with cat(1)
 >  >  resulted in some unexpected behavior.  Then I tried copying ps output
 >  >  and saw the same
 >  >  behavior for long lines.
 >  >  =
 >
 >  >  But still, I validated tmux 2.6 in pkgsrc has the referenced diff
 >  >  applied, and still exhibits the
 >  >  same behavior.
 >  >  =
 >
 >
 >  Mmh, probably you have already done that but just to double-check
 >  that...  Can you please start tmux-2.6 via something like (the `-L'
 >  will hopefully make a difference):
 >
 >   % /usr/pkg/bin/tmux -L tmux-2.6
 >
 >  If `-L' and/or `-S' option is not used and there are tmux sessions
 >  present I think that the problem can still manifest because the
 >  server running can be the (problematic) tmux-2.4 one.^[0]
 >
 >  I hope this will make a difference!... If not, please also share the
 >  terminal used (xterm or similars).

 Indeed, the tmux server was started and TMPDIR socket was still being used from
 the problematic 2.4 to the 2.6 tmux in pkgsrc.  When I exited all of the shells
 from the session, I thought the server would stop but it hangs around.

 "-L"  was enough to get 2.6 working around the existing socket.


 Also, pkgsrc tmux >= 2.6 works around the problem described in bin/53313.


 Thanks!

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.