Am 2022-05-16 18:29, schrieb Adam Borowski:
On Tue, May 10, 2022 at 07:34:25PM +0200, Axel Scheepers wrote:
The terminfo entries stopped being maintained by late 80's.
This doesn't seam to be true. The terminfo files seam to mostly come
from ncurses-term,
the ncurses package seams still to be maintained and getting updates
(https://tracker.debian.org/pkg/ncurses).
Looking at the upstream release notes, which state that they are form
October 21, 2021, quiet a few new ones have been added:
https://invisible-island.net/ncurses/announce.html#h3-database
Therefore, it seams terminfo entries are still being maintained to this
day.
And even if
they were, every new terminal would need to wait several years before
it can
have its definition known by operating systems (today, distributions).
It's not like new kinds of real terminals are produced anymore, at least
I don't know of any.
In case of terminal emulators, they have to be packaged anyway, so a the
terminfo file
can be added to the appropriate package at the same time.
The effect? Most terminals identify as "xterm", "xterm-256color", or
"rxvt". For example both libvt (Gnome-Terminal, etc) and Konsole claim
to
be an xterm...
There are terminals who choose to be compatible to xterm. It probably
has more to do with
programs wrongly hardcoding escape sequences than anything else, and
there is nothing wrong
with making an xterm-compatible terminal. However, that doesn't change
the fact that other
terminals exist as well. In addition to this, if terminals implement
special new escape sequences
(think about recent things like sixel for example), there is no way
around an appropriate
terminfo to make known that it's supported.
And even if $TERM->terminfo were usable, a serial console has no way to
pass
env vars. As an install/rescue tool, apt gets run over a serial
console
pretty often.
It works automatically for terminal emulators. Tools like getty can set
the TERM variable.
Yes, only the operator knows what is connected to a serial console. In
cases where it is not
known, personally, I think a dumb terminal should be assumed to maximize
compatibility.
But I guess in most cases, something like vt100 or xterm will often
work, so I don't mind it
too much. People who really need to can still override it. It's not
automagic, but it works.
Thus, using terminfo is definitely not a "Right Thing" this millenium.
Most new programs just hardcode the codes, assuming a vt100-like
terminal
with a common set of capabilities.
I'm happy to report, that aside from apt, I'm not using any of those
programs.
Yes, there are lazy modern programmers insisting on doing it wrong.
Those programs
will simply fail on various terminals. Let's not promote that, it won't
right it.
Setting TERM works, it works well, and it solves the problem in the best
way possible.
Just because it can't always do it automatically, doesn't mean we should
give up and leave things unfixably broken.
terminfo is the right thing. It is the only way to deal with these
terminals. This will never change.
Regards,
Daniel Abrecht