I’m currently writing a very simple terminal tool and I want to implement the following behavior.
The terminal should display:
Downloading "Something" ...
And after I have completed the download, I want to replace that line with:
Downloading "Something" [Done]
I have seen this done o create the following animation:
[-]
[\]
[|]
[/]
As I don’t have much experience with terminal tools, I don’t know how to implement this simple behavior. Any help would be greatly appreciated.
Use the backspace character —
\b.Don’t forget to flush the output stream, it’s likely buffered.