logoalt Hacker News

muvlon • today at 7:08 PM • 2 replies • view on HN

Terminfo was never a particularly good idea, but in today's day and age it has become simply ridiculous. Its original purpose was to store data about actually manufactured physical terminals, and so it was okay that it was a fixed DB (as opposed to interactively querying the terminal for its capabilities somehow).

These days though, terminals are all software. It would be very easy to just ask them. Instead we still insist on shipping a fixed terminfo or termcaps DB. As a consequence, every new terminal emulator is not in there, and so in order to give their users a tolerable experience, they all lie and say they're xterm-256color. Which completely removes any incentive to actually add them to terminfo/termcaps.

So we have this hellishly complex, nearly Turing complete compatibility system that does no useful work at all anymore.


Replies

skydhash • today at 8:31 PM

> It would be very easy to just ask them. Instead we still insist on shipping a fixed terminfo or termcaps DB.

Isn’t the terminal info easily modifyable? You can add new entries at both the system and user level.

The only actual issues are capabilities. But just like all protocols, there’s need to be an agreement between the software and the terminal. And gradual degradation if some capability is not there. I have more issue with some software hardcoding escape sequences than with not being able to add new terminal entries.

➕ show 1 reply
Someone • today at 7:39 PM

> as opposed to interactively querying the terminal for its capabilities somehow

Querying terminals, in the 1970s when there was a Cambrian explosion in terminal capabilities, with tens of different manufacturers?

Even if you could have gotten all of them to agree this was necessary, I think nobody could afford to put the smartness for such a protocol in their hardware. Hardware was expensive in those days.

➕ show 1 reply