I am trying to animate a loading bar.
It works completely fine in Windows by doing the following:
for(int j=0; j<currentSize; ++j)
cout<<static_cast<char>(219);
for(int k=maxSize; k>=currentSize; k--)
cout<<static_cast<char>(177);
...
for(int l = 0; l<maxBarSize; l++){
cout<<'\b';
When I try in UNIX, however, the backspace command doesn't work. It doesn't delete or print anything. I've also tried using '^H'
intead of '\b'
.
Is it not possible to erase an output console line in UNIX?