I'm writing a very simple little console application and I'm playing around with some ANSI escape sequences to get some nicer output.
What I'm trying to do is something like this. There's a header with a name, and then underneath, as the program runs, several lines are printed. As each line is printed, I'd like to update the header row with a progress meter. eg:
My header row [ 0/5 ]
-------------------------------------
then after some processing
My header row [ 1/5 ]
-------------------------------------
here is some output
...
My header row [ 2/5 ]
-------------------------------------
here is some output
the output could
be over several
lines
I've tried using the save cursor position code (ESC + [s
) and then restoring that position with ESC + [u
, however that only restores the column, not the row.
for some background, this is a Node.JS program. I've looked at node-ncurses briefly, however it seems like a bit of overkill for this task(?)