diff --git a/src/Microsoft.PowerShell.Linux.Host/readline.cs b/src/Microsoft.PowerShell.Linux.Host/readline.cs index 5876aa75ce..7cd46f1107 100644 --- a/src/Microsoft.PowerShell.Linux.Host/readline.cs +++ b/src/Microsoft.PowerShell.Linux.Host/readline.cs @@ -250,22 +250,16 @@ namespace Microsoft.PowerShell.Linux.Host try { - Console.WriteLine("CompletionMatches {0}", cmdCompleteOpt.CompletionMatches.Count); - Console.WriteLine("tabCompletionPos {0}", tabCompletionPos); if (tabCompletionPos > cmdCompleteOpt.CompletionMatches.Count || tabCompletionPos == cmdCompleteOpt.CompletionMatches.Count) - { - Console.WriteLine("in reset of tabCompleitonPos"); - tabCompletionPos = 0; + { + tabCompletionPos = 1; } - tabResult = cmdCompleteOpt.CompletionMatches[tabCompletionPos].CompletionText; - + tabResult = cmdCompleteOpt.CompletionMatches[tabCompletionPos].CompletionText; } catch (Exception e) { - Console.WriteLine("tabCompletionPos {0}", tabCompletionPos); - Console.WriteLine("in exception with e= {0}", e); return; } @@ -274,7 +268,6 @@ namespace Microsoft.PowerShell.Linux.Host //if there is a command for the user before the uncompleted option if (!String.IsNullOrEmpty(tabResult)) { - Console.WriteLine("in not null or empty"); //handle file path slashes if (tabResult.Contains(".\\")) { @@ -282,8 +275,7 @@ namespace Microsoft.PowerShell.Linux.Host } if (this.buffer.ToString().Contains(" ")) - { - Console.WriteLine("the buffer contains a space"); + { var replaceIndex = cmdCompleteOpt.ReplacementIndex; string replaceBuffer = this.buffer.ToString(); @@ -306,8 +298,7 @@ namespace Microsoft.PowerShell.Linux.Host } - BufferFromString(tabResult); - Console.WriteLine("bufferfromstring is {0}", tabResult); + BufferFromString(tabResult); this.Render(); }