TERM environment variable not set
You can see if it's really not set. Run the command set | grep TERM
.
If not, you can set it like that:export TERM=xterm
what does TERM environment variable not set mean?
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.
eclipse TERM environment variable not set
The output is probably from clear
. In order to send the correct sequence to the terminal for clearing the screen, it needs to know the terminal type and uses the TERM
environment variable for it. In eclipse, you don't have a real terminal and no TERM
variable is set.
That being said, don't execute clear
from your own program. It forks a process for no gain, is not portable to non-*nix platforms, breaks the assumption that a normal tool will just write output and not delete anything, and, as you see, depends on the environment.
If you really need control over the terminal as a screen, have a look at the curses
library.
How to properly set environment variable TERM in CLion
Finally found the fix. You must add the Environment Variable TERM=xterm-256color
not in the Console or the CMake config bug in the your Run/Debug configuration.
Related Topics
Linux Removing Folders Older Than 1 Year and More Than 3 Files
Linux: Where Are Environment Variables Stored
Find a Pattern in Files and Rename Them
Why Exit Code 141 with Grep -Q
X86_64 Assembly Linux System Call Confusion
Pattern Match Does Not Work in Bash Script
Command to Change the Default Home Directory of a User
Unix - Create Path of Folders and File
Bind Ctrl+Tab and Ctrl+Shift+Tab in Tmux
Parallel Download Using Curl Command Line Utility
How Would One Disable Nagle's Algorithm in Linux
What Is the Correct Way to Start a Mongod Service on Linux/Os X
Faster Forking of Large Processes on Linux
Prevent Linux Thread from Being Interrupted by Scheduler
File Names with Spaces in Bash
How to Kill All Linux Processes That Are Older Than a Certain Age