Open
Description
Currently, when we pass data stream to cli of asciigraph it outputs the graph to stdout by default.
While this works fine in general, it becomes problematic when plotting in realtime mode as terminal retains the previous graph outputs.
To address this, it would be nice to keep only the latest plot copy in the terminal. To achieve it, clear the already plotted graph first before plotting new when we plotting realtime graph from stdin.
Possible solution: we can utilise ANSI escape sequences to move the cursor and clear the old graph. The following snippets might be helpful:
Move cursor n lines up: fmt.Sprintf("\033[%dA", n)
Clear the line: fmt.Sprintf("\033[2K")
Activity