Exploring terminfo

Alan Gauld alan.gauld at yahoo.co.uk
Thu Jan 14 19:47:02 EST 2021


On 14/01/2021 21:30, Barry Scott wrote:

>> During lockdown I've been digging deeper into the curses module
>> and lately into the tiXXXX family of functions that reside there.

> It seems that curses does not allow you to mix raw stdin/stdout with its calls.

That's true of curses after you call initscr()

But the while point of using the tiXXX terminfo
functions is that you don't need to call initscr to
use them, just setupterm() which does no take control
in the same way.

The problem is the tiXXX functions are not well documented
and there are very few tutorials, even in C!

> If all you want is simple things like bold and clear I'd just use the
> ANSI escape sequences directly.

The whole point of terminfo is to avoid having to use
terminal specific control codes.

> Are there any terminals that do not understand ANSI escape sequences

Lots, most significantly the x3270 IBM mainframe terminals.
Now, whether you can run curses and terminfo on a 3270 I
don't know...
But I suspect the Wyse family are non ANSI compliant too
and there are still some of them around. And of course the
standard xterm emulator supports the Tektronic graphics
terminal emulation so there would definitely be a use there.

But to be honest if I was doing this in anger I'd just
use curses. This is more about exploring the module.
The functions are there and so we should be able to
use them and demonstrate them. But for that we need
tutorials/HowTos etc that cover them. I've already
written a curses HowTo, I'd like to extend it to cover
the terminfo bits too. But for now I'm drawing a blank.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos




More information about the Python-list mailing list