Coder Social home page Coder Social logo

Configure uses the strange term "termlib" about trn HOT 4 OPEN

acli avatar acli commented on June 16, 2024
Configure uses the strange term "termlib"

from trn.

Comments (4)

Eli-the-Bearded avatar Eli-the-Bearded commented on June 16, 2024

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.

from trn.

acli avatar acli commented on June 16, 2024

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.

from trn.

Eli-the-Bearded avatar Eli-the-Bearded commented on June 16, 2024

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.

from trn.

LegalizeAdulthood avatar LegalizeAdulthood commented on June 16, 2024

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.

from trn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.