Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure uses the strange term "termlib" #3

Open
acli opened this issue Jul 31, 2020 · 4 comments
Open

Configure uses the strange term "termlib" #3

acli opened this issue Jul 31, 2020 · 4 comments

Comments

@acli
Copy link
Owner

acli commented Jul 31, 2020

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.

@Eli-the-Bearded
Copy link
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.

@acli
Copy link
Owner Author

acli commented Aug 12, 2020

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.

@Eli-the-Bearded
Copy link
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.

@LegalizeAdulthood
Copy link

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants