I Have done CLI invoking to my program, by these lines of codes
Invoke((Action)(() => textBoxOutput.AppendText(Environment.NewLine + e.Data)))
I am getting output on my GUI Output text Box, But it is not user interactive, if it finds a Question, it will take input automatically and go onto next line.
So, i am looking for solution where I can modify it properly so that it takes user input (For required questioned) and then it goes further.
I tried with flags like,
{
continueProcessingOutput = false;
Invoke((Action)(() =>
{
string userInput = PromptUserForInput(e.Data);
process.StandardInput.WriteLine(userInput);
continueProcessingOutput = true; // Resume processing output
}));
// Pause reading the output to wait for user input
process.CancelOutputRead();
// Prompt user for input on the UI thread
var userInput = await Task.Run(() => PromptUserForInput(e.Data));
rocess.StandardInput.WriteLine(userInput);
// Resume reading the output
process.BeginOutputReadLine();```
Varun R is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.