I am writing a very simple little console application, and I play with some ANSI escape sequences to get a more pleasant result.
What I'm trying to do is something like this. There is a title with a name, and then below it, as the program starts, several lines are printed. When each line is printed, I want to update the title bar with a progress bar. eg:
My header row [ 0/5 ] -------------------------------------
then after some processing
My header row [ 1/5 ] ------------------------------------- here is some output
...
My header row [ 2/5 ]
I tried to use the save cursor position code ( ESC + [s ) and then restore that position with ESC + [u , however this only restores the columns not lines.
for some background, this is the Node.JS program. I briefly looked at node-ncurses , however this seems a bit overkill for this task (?)
source share