Bug 243945

Summary: sysutils/smenu: allow using base ncurses
Product: Ports & Packages Reporter: Steve Wills <swills>
Component: Individual Port(s)Assignee: Danilo G. Baio <dbaio>
Status: Closed FIXED    
Severity: Affects Only Me CC: dbaio
Priority: --- Keywords: needs-patch
Version: LatestFlags: dbaio: maintainer-feedback+
Hardware: Any   
OS: Any   
Attachments:
Description Flags
proposed patch swills: maintainer-approval? (dbaio)

Description Steve Wills freebsd_committer 2020-02-06 20:36:28 UTC
Created attachment 211431 [details]
proposed patch
Comment 1 Danilo G. Baio freebsd_committer 2020-02-07 02:16:42 UTC
Hi Steve.

On CURRENT it's now working fine with ncurses from base.
On FreeBSD 12.1 is still buggy.

How to reproduce:

$ fetch -o /tmp/smenu_list1.txt https://gist.githubusercontent.com/dbaio/8f54ac489557ee165995cd24c10f5a9a/raw/b0e772173a8e6759fe6d1b76c488dce685b6f9f3/gistfile1.txt

$ fetch -o /tmp/smenu_list2.txt https://gist.githubusercontent.com/dbaio/0f1168d090e117dd2aa84b916f50a89d/raw/d3f09180c5b31b4ff9088bd46fced1a39ecdc6fd/gistfile1.txt

$ cat /tmp/smenu_list1.txt| smenu -n10 -c
and
$ cat /tmp/smenu_list2.txt| smenu -n10 -c



### ncurses from base
$ ldd /usr/local/bin/smenu
/usr/local/bin/smenu:
  libncurses.so.8 => /lib/libncurses.so.8 (0x80025f000)
  libc.so.7 => /lib/libc.so.7 (0x8002b6000)


### ncurses from ports
$ ldd /usr/local/bin/smenu
/usr/local/bin/smenu:
  libtinfo.so.6 => /usr/local/lib/libtinfo.so.6 (0x800265000)
  libc.so.7 => /lib/libc.so.7 (0x8002a4000)
Comment 2 Steve Wills freebsd_committer 2020-02-07 13:11:06 UTC
(In reply to Danilo G. Baio from comment #1)
I didn't see an issue, but I was only 12.0. What's the issue I should be seeing?
Comment 3 Danilo G. Baio freebsd_committer 2020-02-09 19:48:38 UTC
(In reply to Steve Wills from comment #2)

smenu-ncurses-base
https://asciinema.org/a/Eq3rXMBl6HK8rixGBrT7g3W9B

smenu-ncurses-port
https://asciinema.org/a/0dnN6MiV6TIlTFUynIDU1OEjn
Comment 4 Steve Wills freebsd_committer 2020-02-12 21:51:31 UTC
(In reply to Danilo G. Baio from comment #3)
Thanks, that helps a lot. I'm still not able to reproduce though:

https://asciinema.org/a/PO34yNsLDmq1u9szlFq18ZzJ7

Am I missing something going wrong there?

Perhaps this is a terminal emulator issue?
Comment 5 Steve Wills freebsd_committer 2020-07-13 20:43:36 UTC
(In reply to Steve Wills from comment #4)
Any update here?
Comment 6 Danilo G. Baio freebsd_committer 2020-07-14 12:29:30 UTC
(In reply to Steve Wills from comment #5)

Hi Steve.

There is still some issue here, don't know if it's ncurses (termcap/terminfo) related or just a bug in smenu.

I found how to reproduce it, it happens in any FreeBSD version, but you will need to connect to a remote host. My old tests were on remote hosts directly.

With hosts near me, (20-40ms) I can't reproduce it.

When trying with hosts > 120ms, it happens all the time.

See this video, connecting to a Vagrant box locally (working fine) and then passing the connection through a remote tunnel (showing the issue).

https://asciinema.org/a/aQxd0s991TzBnuZ8A5Doaq1KS

The different thing we have on ncurses from base and from ports is that in base we use termcap and smenu needs some terminfo capabilities.
Comment 7 Danilo G. Baio freebsd_committer 2020-09-03 22:31:15 UTC
(In reply to Danilo G. Baio from comment #6)

https://github.com/p-gen/smenu/commit/2a801c707b6a1d0d404343bb7903a9b67d9a8721

With this patch smenu is working fine with ncurses from base, waiting the new release to proceed with this PR, there are a lot of changes in the changelog.
Comment 8 commit-hook freebsd_committer 2020-09-18 22:06:42 UTC
A commit references this bug:

Author: dbaio
Date: Fri Sep 18 22:06:06 UTC 2020
New revision: 548922
URL: https://svnweb.freebsd.org/changeset/ports/548922

Log:
  sysutils/smenu: Update to 0.9.16

  Changelog:  https://github.com/p-gen/smenu/releases/tag/v0.9.16

  Many improvements in this versions and we don't need ncurses from ports
  anymore.

  PR:		243945

Changes:
  head/sysutils/smenu/Makefile
  head/sysutils/smenu/distinfo