0

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.

confile
  • 29,115
  • 44
  • 187
  • 340

1 Answers1

1

"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.

Thomas Dickey
  • 43,185
  • 7
  • 51
  • 88