diff --git a/src/Microsoft.PowerShell.Linux.Host/readline.cs b/src/Microsoft.PowerShell.Linux.Host/readline.cs index 532d370141..75d7ee5a81 100644 --- a/src/Microsoft.PowerShell.Linux.Host/readline.cs +++ b/src/Microsoft.PowerShell.Linux.Host/readline.cs @@ -230,10 +230,11 @@ namespace Microsoft.PowerShell.Linux.Host if (previousKeyPress.Key != ConsoleKey.Tab) { cmdCompleteOpt = CommandCompletion.CompleteInput(this.buffer.ToString(), this.current, options, powershell); - if (cmdCompleteOpt.CompletionMatches.Count == 0) - { - return; - } + } + + if (cmdCompleteOpt.CompletionMatches.Count == 0) + { + return; } if (tabCompletionPos >= cmdCompleteOpt.CompletionMatches.Count)