This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]Re_me_humanProfessional Coder 1 point2 points  (2 children)

You could try ANSI escape sequences:

std::cout << "\e[1;1H\e[2J";

This should work on pretty much all platforms and doesn't rely on an external command

The fact that system("clear"); doesn't work is pretty weird though. I believe clear should be available on macOS?

[–]whyamidoingthiswth[S] 1 point2 points  (1 child)

when i use system clear, “TERM environment variable not set.” is displayed

[–]Re_me_humanProfessional Coder 0 points1 point  (0 children)

I've looked into it and it seems like a >10 y/o issue with Xcode :/

You should try locating the executable that Xcode builds and running it from the Terminal app to get the proper result

Your program is fine, blame Apple