SparkyCracked
standard output from Process not giving any output for certain commands
Ok @Abdesol
I can't lie, it may take me some time to figure this out. I managed to get it to the point where it exits the cloning process when done and waits for input again by itself but the actual printing of output is a little tougher. I don't understand the reason it is bombing out as of yet
82 replies
standard output from Process not giving any output for certain commands
@Abdesol Some progress...
I've located a potential issue where the output capturing from the process in C# is not handling the asynchronous nature of the
git clone
operation correctly.
It's super weird so I am gonna try see if I can read the outputs properly and prevent early termination of the process (I mean git still clones cause my massive project managed to clone so it works which is good)82 replies
standard output from Process not giving any output for certain commands
For me I want to see if you ever have more than that one in your code at any point. So when you step in your code, once you print out 'Cloning into...' hover over the variable and see what it's contents are
82 replies
standard output from Process not giving any output for certain commands
Here is some documentation on race conditions
82 replies
standard output from Process not giving any output for certain commands
There might be a potential race condition where the process exits before all output has been read. To mitigate this, consider awaiting the I/O tasks before awaiting
process.WaitForExitAsync()
. This ensures that all output is captured even if the process exits quickly:
82 replies
standard output from Process not giving any output for certain commands
With regards to
git clone
, commands like that output progress dynamically by rewriting lines. It uses \r
as carriage returns intend of \n
and some standard output redirects may not handle that well. So you can either read raw output (which I like to do most of the time) and when you detect \r
then treat it as an instruction to overwrite the current line in your output display.82 replies