The TERM environment variable tells your program what type of terminal is working. Each type of terminal displays data and responds to commands in its own way. For example, the VT100 terminal works very differently than the IBM 3270 terminal.
The error message you see indicates that the TERM environment variable is not set, possibly because you are trying to run your program from Xcode. You can add environment variables that will be set in the Xcode 4 schema settings. As shown below, the rob mayoff exception is, however, the Xcode console is not a proper terminal emulator, so trying to run your program in Xcode will not give you the results you are looking for.
Caleb
source share