Skip to content

Commit 1c23816

Browse files
committed
SuggestionStore::GetCompletions to check exit code of invoked application fixed
Fix dotnet#2147
1 parent d3e8b47 commit 1c23816

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/System.CommandLine.Suggest/SuggestionStore.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,9 @@ public string GetCompletions(string exeFileName, string suggestionTargetArgument
4242
{
4343
process.Start();
4444

45-
Task<string> readToEndTask = process.StandardOutput.ReadToEndAsync();
46-
47-
if (readToEndTask.Wait(timeout) && process.HasExited && process.ExitCode == 0)
45+
if (process.WaitForExit(timeout) && process.ExitCode == 0)
4846
{
49-
result = readToEndTask.Result;
47+
result = process.StandardOutput.ReadToEnd();
5048
}
5149
else
5250
{

0 commit comments

Comments
 (0)