static void ClearConsole() { Console.Clear(); ConsoleTools.DisplayCommandPrompt(); Console.Write(currentText); firstCharHeight = Console.CursorTop; }
/// <summary> /// Display in columns the commands name starting with the given string /// </summary> /// <param name="currentText"></param> static void DisplayPossibilities(string currentText) { // Avoid displaying possibilities when text changed if (autoCompleteResults.Count < 1 || autoCompleteResults.Any(x => x.Substring(0, currentText.Length) != currentText)) { return; } Console.Write('\n'); foreach (var result in autoCompleteResults) { ColorTools.WriteInlineMessage($" {currentText}", ConsoleColor.Cyan); ColorTools.WriteMessage(result.Substring(currentText.Length)); } CustomConsole.firstCharHeight = Console.CursorTop; ConsoleTools.DisplayCommandPrompt(); Console.Write(currentText); autoCompleteResults.Clear(); }