You can repeat the escape sequence \b, which is the backspace, and then write a new message instead of the old one.
Remember that this may not be completely cross-platform, as it depends on the console itself and how it interprets \b, but it should work mostly.
source
share