SyntaxFix
Write A Post
Hire A Developer
Questions
You can use VT100 escape codes. Most terminals, including xterm, are VT100 aware. For erasing a line, this is ^[[2K. In C this gives:
^[[2K
printf("%c[2K", 27);