1

I'm developing an Operating system with cosmos and I'm wondering if someone knew how to clear the console in Cosmos? I want to create a /clear command, and I've tried some solutions, but what is wrong with this code?
Console.Clear();

4 Answers4

1

As you can't scroll as there is no mouse because the GUI is a console. You can just do this(Sorry if there are errors, i've not used c# in 2 weeks.):

    if ((input == "clear"))
{
clear();
}

public static void clear()
{
Console.WriteLine("");

Console.WriteLine("");

Console.WriteLine("");

Console.WriteLine("");

Console.WriteLine("");

Console.WriteLine("");

Console.WriteLine("");

Console.WriteLine("");

Console.WriteLine("");

Console.WriteLine("");

Console.WriteLine("");

Console.WriteLine("");

Console.WriteLine("");

Console.WriteLine("");

Console.WriteLine("");

Console.WriteLine("");


}
0

Console.clear();

This is the best way to clear the console.

DemoDev
  • 11
0

Just doing in short what Dragon Softwares posted Use this Code

public static void clear()
{
    Console.WriteLine("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
}

And call it using

clear();

Edit: The method

Console.Clear();

works in latest version of Cosmos OS tool now there is plug for that you can either update cosmos or use that plug in your cosmos template

Zahid Wadiwale
  • 96
  • 1
  • 10
0

I Use Some Clear Method

Console.Clear()
Isaac Vinícius
  • 21
  • 1
  • 11