InteractivePrompt
InteractivePrompt copied to clipboard
Request for exit conditions
Would it be possible for the call to exit the Run loop (Environment.Exit(0)) today to instead be a lamda. Im my case I ideally do not want the process to exit, just exit the command shell. On the same vane, could the Run lamda have a way to indicate that the run loop should exit so exit/quit etc commands can be implemented in addition to the escape key?
Proposed changes:
if (lastKey.Key == ConsoleKey.Escape)
return; // Environment.Exit(0);
var result = lambda(cmd, input, completionList);
if (result.Output != null) Console.Write(result.Output);
if (result.Continue == false) return;
With the processing lamda returning (bool Continue, string Output) vs just the string it does today.