This is the code:
ConsoleKeyInfo cki;
while((cki = Console.ReadKey(true)).Key != ConsoleKey.Escape)
{
Console.WriteLine(cki.Key);
}
When i run it from cmd or powershell with dotnet run everything works fine. However when i run it from Git Bash it throws the following exception:
Unhandled exception. System.InvalidOperationException: Cannot read keys when either application does not have a console or when console input has been redirected. Try Console.Read.