shellprogressbar
shellprogressbar copied to clipboard
Crashes in git bash
Maybe its expected since it´s not written any support, but it could be good to know that it doesnt work in git bash on windows, it fails:
Unhandled Exception: System.IO.IOException: The handle is invalid.
Splendid lib otherwise :-)
I have the same issue. At least I'm not alone :) Does @Mpdreamz plan to include Git Bash for Windows support in the future?
What runtime are you using?
I tested this with .NET Core 2.1.0 and it does crash. I don't think this can be fixed in this library though. I think it needs to be fixed in dotnet/corefx. The problem is that System.Console is trying to use Windows APIs on a unix terminal emulator.
Here is the full stack trace for reference.
$ dotnet run -p src/ShellProgressBar.Example/
Unhandled Exception: System.IO.IOException: The handle is invalid
at System.ConsolePal.GetBufferInfo(Boolean throwOnNoConsole, Boolean& succeeded)
at System.ConsolePal.Clear()
at System.Console.Clear()
at ShellProgressBar.Example.Program.RunTestCases(CancellationToken token) in C:\Users\david\Documents\GitHub\shellprogressbar\src\ShellProgressBar.Example\Program.cs:line 95
at ShellProgressBar.Example.Program.MainAsync(String[] args, CancellationToken token) in C:\Users\david\Documents\GitHub\shellprogressbar\src\ShellProgressBar.Example\Program.cs:line 57
at ShellProgressBar.Example.Program.Main(String[] args) in C:\Users\david\Documents\GitHub\shellprogressbar\src\ShellProgressBar.Example\Program.cs:line 48
I rarely use windows, so I'm not interested in perusing a fix here, but I think it should be possible for System.Console to try to detect if it is running on a non-windows terminal and try to use System.ConsolePal.Unix instead.
I'm seeing this same error while using the Powershell terminal in VS Code. Does that change the assessment of this issue?
Please try: https://www.nuget.org/packages/ShellProgressBar/4.1.1 it works for me in the Bash on Windows terminal.
@Mpdreamz, this issue still occurs when using Visual Studio Code. Tested with 4.1.1.
@jamesrom what operation system do you use?
@Mpdreamz, VS Code on Windows 10.
I was running into this issue with Version 5.0.0. Turns out that it was an issue in Visual Studio Code and its built in terminal. See: https://github.com/OmniSharp/omnisharp-vscode/issues/2336
Using 'externalTerminal' in Visual Studio Code launch settings resolved this for me.
"configurations": [ { "name": ".NET Core Launch (console)", "type": "coreclr", "request": "launch", ... "console": "externalTerminal" },
NOTE: I don't know how to stop github collapsing code blocks.