Recently, I was working on a project that needed a simple UI. To save time, I decided to use a Windows Console application. After implementing some simple commands, I thought it would be neat to allow the user to use autocomplete functionality (using the Tab key).
After doing some research, this turned out not to be as straightforward as I first thought. A lot of solutions offered for this problem included using the Console.ReadKey method. The problem with using this method is that it will disable a lot of other functionality like using the arrow up/down keys to scroll through the history of typed commands. Functionality I wanted to keep.
After some more Googling, I didn’t find any solution to this problem and I decided to write my own. I decided to write an article about this and post it on CodeProject.com.
Code Project has often helped me out with useful articles. Time to do something in return.
The article can be found here: https://www.codeproject.com/Articles/1182358/Using-Autocomplete-in-Windows-Console-Applications