0

I am new to coding with VSC this semester and I don't know much.

I installed vsc, c# and .net core (not sure if I need anything else).

Since I know very little I followed a Youtube tutorial to learn the basics. Everything worked fine until he wanted to change text color. I copied every step but I noticed that the debug console is not changing the text color and that the Youtuber was using an external terminal/console (don't know the difference). I thought who cares about color and just continued with the video. Some code later he wrote an input:

// Ask users name
Console.WriteLine("What is your name?");

// Get user input
string inputName = Console.ReadLine();
        
Console.WriteLine("Hello {0}, let's play a game...", inputName); 
// This is never displayed  after giving the debug console a name

Copied the input but all I was able to do in the debug console is typing name after name and nothing happens. The program runs forever if I do not close it. Than I thought the problem was the debug console and I started to google how to change that. So I googled again and again and was not able to find how to change the console to an external one all things I found were not helpful to me.

Long story short. How can I change the terminal or console form not using the debug console so I can change the text color and so on?

Thanks in advance Jona

J.F.
  • 13,927
  • 9
  • 27
  • 65
Jona
  • 1
  • 2
    Add `Console.ReadLine();` to the end of your code – Sajjad Mortazavi Jan 20 '21 at 12:45
  • This may answer your question: https://www.google.com/url?sa=t&source=web&rct=j&url=https://stackoverflow.com/questions/42606837/how-do-i-use-bash-on-windows-from-the-visual-studio-code-integrated-terminal&ved=2ahUKEwjpluyq0a_uAhWOXM0KHawFAUwQFjABegQICRAB&usg=AOvVaw0iK9s2CpjHN8Ulzn8z6_3U. – IdusOrtus Jan 22 '21 at 13:25

1 Answers1

-1

Use this in your code to change color. Replace Blue if you like some other colors.

Console.ForegroundColor = ConsoleColor.Blue;

Roger
  • 35
  • 4
  • Thanks but the debug console will not change its color, that s why I am looking for help how to get an external console – Jona Jan 20 '21 at 12:57