Find unix TERM within C program.
Posted on 1999-01-26
I am writing a file viewer, which will be used on different terminals in Unix environment. How can I find the current terminal type from within my C program. I tried using the following code:
str1 = (char *)(system("echo $TERM"));
printf("Terminal Type is: %s\r\n", str1);
But, it only echos the term type on the screen, and does not send anything in the variable str1. Any suggestions??