Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 02 Nov 2023 18:58:55 +0100
From:      Steffen Nurpmeso <steffen@sdaoden.eu>
To:        Jamie Landeg-Jones <jamie@catflap.org>
Cc:        freebsd-current@FreeBSD.org, dickey@his.com, bapt@FreeBSD.org
Subject:   Re: Freebsd 14+ -- tcsh incompatible with terminfo
Message-ID:  <20231102175855.A1pj0%steffen@sdaoden.eu>
In-Reply-To: <202311020241.3A22f4o3042181@donotpassgo.dyslexicfish.net>
References:  <202310312245.39VMjNJB080965@donotpassgo.dyslexicfish.net> <202310312259.39VMxm6W081150@donotpassgo.dyslexicfish.net> <ZUGZPWBSt80p3jHa@prl-debianold-64.jexium-island.net> <202311010349.3A13nX1M094463@donotpassgo.dyslexicfish.net> <20231101220247.HGrrB%steffen@sdaoden.eu> <202311020241.3A22f4o3042181@donotpassgo.dyslexicfish.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Jamie Landeg-Jones wrote in
 <202311020241.3A22f4o3042181@donotpassgo.dyslexicfish.net>:
 |Steffen Nurpmeso <steffen@sdaoden.eu> wrote:
 |> Why?
 |> (That is to say: why -- if it is a *real* termcap?  If it is only
 |> a translation layer to terminfo, i am with you.  But otherwise
 |> not, i think a real termcap is much, much smaller, while offering
 |> anything a (simple) console program needs.)
 |> That is not to talk small the efforts of Mr. Dickey.  But for
 |> example the mailer i maintain *can* directly use BSD termcap if so
 |> desired, and it works just nice.
 |
 |I agree that termcap does most of what we need already, so my main
 |reason is that there are 2 different systems in use to do the same
 |job, which is annoying. (FreeBSD doesn't exist in a vacuum) As terminfo
 |exists, is supported, and has terminal entries that our termcap doesn't
 |have, it seems to be better to switch to that. I'm sure it would mean
 |less maintenance for the FreeBSD committers too.

I do understand that a bit.  Other than that plain termcap was so
small and i would assume essentially unchanged for decades, that
i do not.  Termcap entries, yes.  I could imagine vt220, xterm,
screen-256color, and take one of st-256color, whatever KDE and
GNOME terminal, and rxvt-unicode.  Makes seven.  Likely
automatically extractable via "infocmp -C" of Dickey's terminfo.

Let's just try that:

  $ rm .TCAP;\
    for f in vt220 xterm screen-256color st-256color \
        rxvt-256color gnome-256color konsole-256color; do \
      infocmp -C $f >> .TCAP;\
    done;\
    ls -l .TCAP
  -rw-r----- 1 steffen steffen 7145 Nov  2 18:40 .TCAP

Not that i come over as a sarcastic person.

 |If terminfo didn't exist, I'd live with termcap.
 |
 |There are also benefits to terminfo:

No.  It is not "also", it is that there are.
And that programs which use facilities of modern terminfo require
terminfo anyway.

Yet it is that many console programs do not (by far), nor do they
know how to use all the amazing things that are possible with
a UNIX terminal (just by glancing over ECMA-48, plus some OSC
extension, plus superficial glancing over tmux console
interaction).

A real (non-wrapper) termcap library is very (very) small, so
small that it could be a header-only thing that is included in
every program (statically that is).

 |https://invisible-island.net/ncurses/ncurses.faq.html#extended_term
 |
 |We don't even run with a "proper" termcap anyway!
 |
 |"The base system's terminal database is referred to as =E2=80=9Ctermcap.d=
b=E2=80=9D
 |but is actually an ncurses terminfo hashed database." -  https://invisib\
 |le-island.net/ncurses/ncurses.faq.html#what_platforms
 |
 |So, yeah, despite Mr Dicky's success in making working with both as \
 |seamless
 |as possible ,it would still just be nice to not have to deal with 2 \
 |different
 |standards, that's all.
 |
 |"setaf or AF, that is the question."

So to say.  For example the MUA i maintain needs 12 commands at
maximum (then also 2 for ca_mode and 2 for keypad on/off,
8 otherwise).  This is sufficient for complete control over
command line editing.  If it would, like bash, would implement
multi-line editing it would add i think one or two on top, for
vertical movement.  All these commands are several decades old and
exist everywhere.

Add some queries for auto_right_margin, eat_newline_glitch,
max_colors etc, and several dozen special-key bindings.  The same
is true for those.  You get away without them, of course.

But i tell you what.  Instead of, i do not know, 50 or so
kilobyte, on this Linux system we indeed end up linking against
libncursesw.so.6.4 that is almost half a megabyte and has lots of
symbols and other linker work to be done.

The *complete* ncursesw library!

O tempora, o mores!

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20231102175855.A1pj0%steffen>