Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Feb 2023 15:26:22 -0500
From:      Thomas Dickey <dickey@his.com>
To:        Kurt Hackenberg <kh@panix.com>
Cc:        questions@freebsd.org
Subject:   Re: Cursing the tput utility - the penguin strikes again
Message-ID:  <20230223202622.GA4604@prl-debianold-64.jexium-island.net>
In-Reply-To: <Y/fJGCedB3Fk17xa@rain.cave>
References:  <974a81c2-a92d-7f94-5f96-869bddfe21f3@fjl.co.uk> <Y/fJGCedB3Fk17xa@rain.cave>

next in thread | previous in thread | raw e-mail | index | archive | help

--VS++wcV0S1rZb1Fb
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Feb 23, 2023 at 03:14:16PM -0500, Kurt Hackenberg wrote:
> On Thu, Feb 23, 2023 at 04:45:21PM +0000, Frank Leonhardt wrote:
>=20
> > So there's a tput utility for controlling the terminal in BSD.
> ...
> > Well use the tcap utility on non-BSD platforms and it suddenly doesn't
> > work. It turns out that the penguinistas thought using the "Cap Name"
> > instead of the "TCap Code" was a good idea. Some of the codes are the
> > same, some are not. In fact most are not.
>=20
> The trouble is those are two different mechanisms, based on two different
> file formats, that do the same thing.
>=20
> The two file formats are "termcap" and "terminfo", both from the default
> names of the system files that use them. Manual section 5 has pages about
> both. They're similar, but different enough to be incompatible.
>=20
> The "TCap codes" are the names used in termcap format; the "Capnames" are
> the names used in terminfo format. (A "cap" is a terminal "capability".)
>=20
> I think termcap came first, and then somebody invented terminfo as an
> improvement or a reimplementation of the same idea. I think termcap came
> from Berkeley Unix -- maybe invented for vi -- so FreeBSD more or less
> stayed with it. Maybe terminfo came from Bell Labs; I think Linux prefers
> it.

most do (FreeBSD's userland is an exception)

It's actually ncurses (and terminfo) underneath the facade.

related -

https://invisible-island.net/ncurses/tctest.html
=20
> This is pointlessly incompatible, the result of haphazard evolution, and
> kind of a mess. It's all about 40 years old.
>=20
> The library functions that use those terminal descriptions were in the
> library "curses" (from "cursor"), long ago superseded by "ncurses" (new
> curses). Probably the program tput uses the library ncurses. You might wa=
nt
> to look at that library; maybe there's a compatibility layer. Or, as Dani=
el
> Tameling suggested, maybe there are two different version of ncurses.

just one -

https://invisible-island.net/ncurses/ncurses.faq.html#platform-portable

(but reading the FreeBSD sources would tell more)

--=20
Thomas E. Dickey <dickey@invisible-island.net>
https://invisible-island.net

--VS++wcV0S1rZb1Fb
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQGzBAABCgAdFiEEGYgtkt2kxADCLA1WzCr0RyFnvgMFAmP3y+oACgkQzCr0RyFn
vgMavAv/Z0U5vYHWn/X8jKLBcGMmy5E27qUWqE/6ZkxK5FiXyvlAOnH+Odhhrmue
tNP9bDTtxmr2NQ8CdSQ6WShw+J8/agkfUs3sHOavTMw/D66bJ3CXvdyM+Z7ic7Jy
bZkG/Be4+o7amPwUnAQwbtMVx4vfapQ/PdPLc/q38JTe4pQGaxhe0H6yf1cg1eiu
ECpcS/EA5q6yqzxHdy7Nc8MqclYH160/VkDPhMjWLGZo78xvm1uLJXajgGeDnTVr
AcepjzIAcubHxBdgS8qRo3v3h8Sx8wPdZ0t5ZTHKleO/DOpPRnql5LBIHdTG7lrX
Xp9f99ihCVE9QQq27eBgVpHlK14V/jtV0GbTryxDA9G5tCyywX293z3o94lOAn7L
hnOWN7aSZ8TaKriPSBwE7TxAQj4+Oh/goerlMXPfADCW8GKuEB37PNv2vAftKDNw
X57GKN20Wcm98fwZFKWMmPdSTK9SCbGib9NfYaDxTAykmBtbJaNQz0aT5cYZP3iB
iKMafcxa
=6g1t
-----END PGP SIGNATURE-----

--VS++wcV0S1rZb1Fb--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20230223202622.GA4604>