Search code examples
objective-cunixosx-snow-leopard

what does "TERM environment variable not set" mean?


I was writing a simple console application in Objective C.

I have tried system("clear") but I am getting this message on console

"TERM environment variable not set."

Can anyone explain me what this is all about ?

I am very new to both OSX and Objective C. and I am sorry if this question is too dumb as I have not programmed much on *nix. (I have been doing a lot of Java and PHP development in my college days).


Solution

  • The TERM environment variable tells your program what type of terminal its running on. Each type of terminal displays data and responds to commands in its own way. For example, a VT100 terminal works quite differently from a IBM 3270 terminal.

    The error message you're seeing says that the TERM environment variable isn't set, probably because you're trying to launch your program from within Xcode. You can add environment variables to be set in Xcode 4's scheme settings. As rob mayoff points out below, though, Xcode's console isn't a proper terminal emulator, so trying to run your program within Xcode isn't going to give you the results you're looking for.