Using CLion on OSX, I'm creating a simple console app in which I want to do a system("clear")
. When I'm running the app in the OSX terminal, it works without issue. When I run it using the CLion terminal, the system("clear")
fails with message :
TERM environment variable not set.
I first tried to manually set it in my cmakelists.txt
file without success by doing
set(ENV{TERM} "xterm-256color")
I then tried to manually set it (followed by full restart) in CLion settings for both Console and CMake sections in Build, Execution, Deployment using the following key/value pair (Environment option):
TERM xterm-256color
In my OSX terminal, doing a env | grep TERM
prints out
TERM_PROGRAM_VERSION=388
TERM_PROGRAM=Apple_Terminal
TERM=xterm-256color
What am I missing? I unfortunately can't find it...
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.