1. Open Mono command prompt
2. Enter "csharp"
3. The REPL starts, but doesn't accept any inputs, not even Ctrl+C. The mono process needs to be killed via Task manager.
Running csharp.exe on MS.NET works as expected.
Tested using official Mono 3.12 install on Windows 8.1, with Powershell/cmd/mingw-bash.
Interestingly, in cygwin-bash the csharp.exe fails with a DivideByZeroException:
>System.DivideByZeroException: Division by zero
> at Mono.Terminal.LineEditor.UpdateHomeRow (Int32 screenpos) [0x00000] in C:\buildroot\release\repos\mono\mcs\tools\csharp\getline.cs:228
> at Mono.Terminal.LineEditor.Render () [0x00091] in C:\buildroot\release\repos\mono\mcs\tools\csharp\getline.cs:223
> at Mono.Terminal.LineEditor.InitText (System.String initial) [0x00023] in C:\buildroot\release\repos\mono\mcs\tools\csharp\getline.cs:811
> at Mono.Terminal.LineEditor.Edit (System.String prompt, System.String initial) [0x0004a] in C:\buildroot\release\repos\mono\mcs\tools\csharp\getline.cs:841
> at Mono.CSharpShell.GetLine (Boolean primary) [0x00037] in C:\buildroot\release\repos\mono\mcs\tools\csharp\repl.cs:245
> at Mono.CSharpShell.ReadEvalPrintLoopWith (Mono.ReadLiner readline) [0x00007] in C:\buildroot\release\repos\mono\mcs\tools\csharp\repl.cs:338
> at Mono.CSharpShell.ReadEvalPrintLoop () [0x0009e] in C:\buildroot\release\repos\mono\mcs\tools\csharp\repl.cs:370
> at Mono.CSharpShell.Run (System.String startup_files) [0x00007] in C:\buildroot\release\repos\mono\mcs\tools\csharp\repl.cs:536
> at Mono.Driver.Main (System.String args) [0x00180] in C:\buildroot\release\repos\mono\mcs\tools\csharp\repl.cs:90
I can reproduce the described behaviour.
OK, there seem to be two distinct failures.
Desktop Mono has three console drivers - "Null", "Windows" and "TermInfo".
The Windows driver is used in cmd/PowerShell. It's broken, I'm on it.
The Null driver is used in Cygwin - but it should be the TermInfo driver. I'm also on it (but the detection code is in the Mono runtime, not the classlib, so blurghhh)
The good news is I've isolated the bug which causes the cmd.exe breakage. The bad news is it's surprisingly deep in the runtime internals - 7968a8df1674a6e2aa8990faaca3c426efc2e279
This one is outside my ability to fix, I'll need to sweet-talk the runtime team
Should be fixed by bba332f502aa974fc3e42ed83c4a77a4f806d6e8