Skip to content

Configure uses the strange term "termlib" #3

Open

Description

@acli

The Configure script uses the strange term "termlib". It should be updated to mention termcap/terminfo since the latter are terms people actually use; "termlib" isn't.

Activity

  1. Eli-the-Bearded commented on Aug 12, 2020

    @Eli-the-Bearded
    Contributor

    The termlib is the terminal control library. Generally curses or ncurses these days. I believe it dives into plain termcap / terminfo if it can't use curses.

  2. acli commented on Aug 12, 2020

    @acli
    OwnerAuthor

    The termlib is the terminal control library. Generally curses or ncurses these days. I believe it dives into plain termcap / terminfo if it can't use curses.

    Hmm. Interesting. Thanks for the info. I’ll try to dig deeper into the code, my understanding of it still very superficial.

  3. Eli-the-Bearded commented on Aug 12, 2020

    @Eli-the-Bearded
    Contributor

    In your "whiteboard" you describe this as have a "Perl-style" configure. I think the truth is Perl has an "rn-style" configure. This code is old and was designed to compile on a lot of diverse environments. The configure script to figure things out was I think introduced with rn, and it (among other things) figures out what code is needed for the terminal.

    It's pretty effective. I got Perl 1.0.0 running last year on Centos using the configure script. If I had had to find a period automake or the like, I'd probably have been screwed.

  4. LegalizeAdulthood commented on Apr 18, 2023

    @LegalizeAdulthood

    termlib is a lower-level library than curses. Curses provides refreshable screen regions as buffers that the application updates and then commands curses to refresh the screen from the buffers. Curses examines the changes to the buffers and attempts to emit the smallest possible set of control sequences to the terminal in order to make the screen match the appearance of the buffers.

    termlib is the library that obtains the terminal capabilities from the termcap/terminfo database. It has rudimentary facilities for constructing the proper ESC sequences for sequences that are parameterized, or for sequences where additional buffering characters (depending on the baud rate) are needed in order to allow a terminal sufficient time to complete the requested operation. While the operation is pending, the terminal generally isn't listening to the host interface, so commands (like clearing the screen) that take a long time to execute in the terminal are generally followed by a series of NUL pad bytes in order to give the terminal time to process the request.

    curses uses termlib in order to obtain the appropriate ESC sequences for a given terminal type as described by the termcap/terminfo database. In term.h the variables tc_BC, etc., all refer to the named terminal capabilities in termcap/terminfo by the name of the capability, e.g. the bc capability describes the backspace character used by the terminal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions