NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: misc/59965 (terminfo(5): missing rxvt-unicode)



From: Taylor R Campbell via gnats <gnats-admin%NetBSD.org@localhost>
To: <roy%netbsd.org@localhost>, <gnats-admin%netbsd.org@localhost>, <netbsd-bugs%netbsd.org@localhost>, <campbell+netbsd%mumble.net@localhost>
Date: Thu, 12 Feb 2026 23:10:01 +0000
Subject: Re: misc/59965 (terminfo(5): missing rxvt-unicode)

 >  Thanks!  Can you share the patches?

terminfo patches - this is probably good to go
https://mollari.netbsd.org/~roy/terminfo-cdbdir.patch

rxvtv-unicode patches - this probably needs some more work
https://mollari.netbsd.org/~roy/rxvt-unicode-terminfo.patch

 >  
 >  Let me see if I understand correctly what you mean:
 >  
 >  1. rxvt-unicode will be extended with an INSTALL script that will
 >     cause the following command to be run at package installation time
 >     (pkg_add):
 >  
 >      tic -x -o ${PREFIX}/share/terminfo \
 >          ${PREFIX}/share/examples/rxvt-unicode/rxvt-unicode.terminfo
 >  
 >     => So ${PREFIX}/share/terminfo is a cdb file, not a source file?
 >        Should it be called ${PREFIX}/share/terminfo.cdb, like we have
 >        /usr/share/misc/terminfo and /usr/share/misc/terminfo.cdb?

${PREFIX}/share/terminfo is a directory
NetBSD tic will output: ${PREFIX}/share/terminfo/r/rxvt-unicode.cdb
ncurses tic will output: ${PREFIX}/share/terminfo/r/rxvt-unicode OR ${PREFIX}/share/terminfo/r/rxvt-unicode.db depeding on how it's built

 >  
 >     => And presumably other packages providing terminfo descriptions
 >        will do something similar, so that ${PREFIX}/share/terminfo
 >        takes the union of all of them?

cdb won't work well with unions, we would need to consult each source all the time and if there is any error then boom, things stop.
For pkgsrc, a compiled term description per terminal is a better way forwards I think.

 >  
 >     => Ideally, it would be a single command line we can run to gather
 >        all packages' installed terminfo files -- that way, after
 >        installing a _batch_ of packages, we can run a single tic
 >        invocation to generate the .cdb file in O(#packages) time,
 >        instead of running it once for each package taking
 >        O(#packages^2) time.
 >  
 >        (pkg_add(8) doesn't currently have a mechanism to do this, but
 >        there's a strong need for it to grow such a mechanism, e.g. for
 >        TeX packages to run mktexlsr or regenerate font databases, and I
 >        have a plan implement it.)
 >  
 >  2. Once libterminfo is patched, applications linked against
 >     libterminfo will automatically search for terminfo entries in
 >     either:
 >  
 >      (a) $TERMINFO, if it is set; or
 >      (b) $TERMCAP, if it is set; or
 >      (c) the first path with a match in $TERMINFO_DIRS,
 >          colon-separated; or
 >      (d) the first path with a match in:
 >  
 >          ~/.terminfo.cdb
 >          ~/.terminfo
 >          /usr/share/misc/terminfo.cdb
 >          /usr/share/misc/terminfo
 >          /usr/pkg/share/terminfo.cdb (?)
 >          /usr/pkg/share/terminfo
 >  
 >  I wonder whether we should have something like a _single_
 >  /var/db/terminfo.cdb (and maybe terminfo.cdb), populated by a list of
 >  sources, like /etc/man.conf's _default list for populating
 >  /var/db/man.db or /etc/ssl/certs.conf's path list for populating
 >  /etc/ssl/certs.  That way:
 >  
 >  (a) we don't have /usr/pkg baked into libterminfo.so (e.g., mine will
 >      be in /pkg/20xxQy), but
 >  (b) we keep the logic for actually using the database simple, and
 >  (c) we can easily take the union of various inputs --
 >      /usr/share/misc/terminfo, /opt/pkg/share/examples/rxvt-unicode,
 >      whatever.
 >  
 >  But maybe this is too much indirection.

Heh yes.
In your case you'll likely want
TERMINFO_DIRS=/usr/share/misc/terminfo:/pkg/20xxQy/share/terminfo

 >  
 >  > Once done, all you would have to do is pkg_add rxvt-unicode to get
 >  > the terminfo definitions added to the base system automatically.
 >  > Which just saves you the step of following the existing package
 >  > message of adding it yourself ;)
 >  
 >  There's one more step: the terminfo description needs to be installed
 >  on _remote_ hosts, which don't have anything graphical in them.  So
 >  ideally we would have a separate rxvt-unicode-terminfo package that
 >  doesn't pull in X the way the rxvt-unicode package does.
 >  
 >  > Would this satisfy this issue?
 >  
 >  Well, I was hoping we could just ship a rxvt-terminfo description in
 >  NetBSD out of the box without having to install any packages!  But
 >  this is good too -- we should, after all, have a way to install
 >  packages for new terminfo descriptions and have everything in the
 >  system just work with them.

Yes, I can understand this pain as well.
Likewise we want a method of updating an existing NetBSD system easily with new descriptions
and upgrading it may not not possible or desirable.

Also I don't want to maintain patches against the upstream terminfo descriptions we use.
If we do want to add rxvt-unicode and others we may want to adjust the build mechanism to append the new descriptions to the base source and build from that.

Roy


Home | Main Index | Thread Index | Old Index