I am using Eclipse Oxygen.3A for development with C, and the operating system on which I'm running is Fedora 28. The C project that I am attempting to debug contains multiple instances of system("clear");
. When I would compile and run the application from Fedora's local terminal, any calls to system()
would behave normally. After using Eclipse's debug tools to "step over" the statement and execute it, the launch terminal printed garbage (see screenshot below). The same output is printed every time the program is run.
I created a new project with the same environment variables which isolated that statement, but received the same result (see screenshot below). The only environment variable present in either launch configuration is TERM
which is set to xterm-256color
(the value printed by Fedora's local terminal when given the input echo $TERM
). I couldn't find any results online pertaining to this particular issue, and don't understand how the function is implemented during compilation.
Contents of source file in Test project: #include
int main(void) {
system("clear");
return 0;
}
Generated output:
'[ESC]' + "[3J" + '[ESC]' + "[H" + '[ESC]' + "2J"
Note: Imagine this string concatenated. I couldn't write the output literally because StackOverflow is unable to represent the "escape" character.
My knowledge of Linux, bash and the tools provided by GNU is fairly limited, so let me know if any more information on this case would be helpful along with how to obtain it. Also, any feedback on how I could improve this post is welcome.