tareqimbasher / NetPad

A cross-platform C# editor and playground.
MIT License
1.09k stars 56 forks source link

weired behaviour when calling multiple Console.ReadLine() methods, user input got stuck #218

Closed pinkli closed 1 week ago

pinkli commented 2 weeks ago

when call multitple Console.ReadLine(), I get no user input from the second or the third call. demo code as below

string? userinput;

Console.Write("User1 > ");
userinput = Console.ReadLine();
Console.WriteLine(userinput);

Console.Write("User2 > ");
userinput = Console.ReadLine();
Console.WriteLine(userinput);

Console.Write("User3 > ");
userinput = Console.ReadLine();
Console.WriteLine(userinput);

Console.Write("User4 > ");
userinput = Console.ReadLine();
Console.WriteLine(userinput);

sometimes it stops at printing "User3 >" without reading the actual user input, sometimes it stops at "User2 >"; "User4 >" never prints in my machine. sometimes the NetPad got freeze not responding. I'm using Mac X64 Sonoma 14.5, NetPad 0.7.1, .Net 8.

WX20240620-120307@2x

tareqimbasher commented 2 weeks ago

I'll take a look! Thank you for reporting.

tareqimbasher commented 1 week ago

v0.7.2 is released with this bug fixed!