How to handle outputs that alter the same line and remove lines while running a process?
Hello, I am trying to run a process in a C# program and the process output alters on the same line. Like, it shows percent, and then removes some lines and shows another line. Currently, using StandardOutput, I am not able to capture such scenarios. Is there any workaround to this? Thank you!
5 Replies
Yeah, you set the cursor position and write again.
I mean how do I set that?
This is the function in which I am printing the buffer I recv from stdout
one of the processes that are not working well, forexample, is git clone command, it shows the first cloning text, after that it doesn't show the rest of the output (the progress, etc..) and finally terminates without any additional output
use
Console.SetCursorPosition(int left, int top
)Ah.. i see.. then where do I get the cursor points to set accordingly?
I don't have all the code, but you can probably figure it out based on how many times youve written things.