‹ BackHN Continuity

Thread

A Minsky machine in ncurses terminfo

31 points · 11 comments · beefburger

  1. muvlon · · focus · 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.

    1. skydhash · · focus · HN ↗
      > 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.

      1. muvlon · · focus · HN ↗
        Yes you can add entries, but it's still an awful design. It's like if the web didn't have media queries and such and instead everyone ships a big database of user agent strings that websites check in order to know what features they can use.

        And no, caniuse or browserlist are not that. Yes they contain data on what browsers support what, but that's only to guide your compatibility decisions. You can still opportunistically try to use a feature and a new browser that's not in the DB can handle it correctly without having to lie in its UA string.

        1. skydhash · · focus · HN ↗
          > It's like if the web didn't have media queries and such and instead everyone ships a big database of user agent strings that websites check in order to know what features they can use.

          Do remember that both the interface (the terminal) and the software environment is under the control of the same user. And terminfo is more of a translation layer than a database, more like the Linux virtual filesystem which hides away the different filesystem implementations. Or ALSA and DRM.

          Going back to the issue on the software side, many time, the only check they do is checking if stdout is a file or a tty. If it’s the latter, their output is full of color and spinners, no matter if TERM is explicitly ’dumb’.

Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.