This project is read-only.

Tab Completion

Topics: Bug Report, Feature Request
Aug 11, 2011 at 4:23 PM

I've found a strange behavior with tab completion in PoshConsole.

For example, start Posh Console, enter "ls " command (with a space at end). Press Tab and... command duplicates (new command becomes "lsls ").

I've wrote quick fix for this 'bug'. Here is diff.

diff -r 9ac7432f3c51 HuddledControls/ConsoleControl/ConsoleControl.EventHandlers.cs
--- a/HuddledControls/ConsoleControl/ConsoleControl.EventHandlers.cs Fri May 20 03:15:04 2011 -0400
+++ b/HuddledControls/ConsoleControl/ConsoleControl.EventHandlers.cs Thu Aug 11 22:22:26 2011 +0700
@@ -224,7 +224,7 @@
Math.Abs(ScrollViewer.ViewportHeight - position.Y)),
choices, CurrentCommand);
}
- else
+ else if (_expansion.GetChoices(cmdline).Count != 0)
{
string tabExpansion = e.IsModifierOn(ModifierKeys.Shift) ? _expansion.Previous(cmdline) : _expansion.Next(cmdline);
CurrentCommand = cmdline.Substring(0, cmdline.Length - cmdline.GetLastWord(false).Length) + tabExpansion;// + (hasMore ? CurrentCommandPostCursor : string.Empty);