Reputation: 97
Nobody know a good way to take the terminfo key string in a C program? Like the infocmp of ncurses. I can't find anything :(
If someone know and want to tell me, I will be very thankful.
Upvotes: 0
Views: 628
Reputation: 54475
"Capturing" the value depends on what you are trying to do with it. The usual application uses the tigetstr
function to read the value for a given terminal capability from the terminal database.
To do this, you must first initialize the terminfo interface using the ncurses library, for example using setupterm
, setterm
or newterm
. The choice of function depends on what the program will be doing with the string.
In ncurses-examples, there are a few low-level terminal programs such as demo_terminfo
.
Upvotes: 1