It (just printing
\r) won't work in the context of a browser .. It can, as the poster states, work in the context of a console application, but note that something from
curses or
console or
term will probably be better/more robust (again, just for console apps -- not your browser-context issue).