Comments (8)
I have the same issue. At least I'm not alone :) Does @Mpdreamz plan to include Git Bash for Windows support in the future?
from shellprogressbar.
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.
from shellprogressbar.
I'm seeing this same error while using the Powershell terminal in VS Code. Does that change the assessment of this issue?
from shellprogressbar.
Please try: https://www.nuget.org/packages/ShellProgressBar/4.1.1 it works for me in the Bash on Windows
terminal.
from shellprogressbar.
@Mpdreamz, this issue still occurs when using Visual Studio Code. Tested with 4.1.1.
from shellprogressbar.
@jamesrom what operation system do you use?
from shellprogressbar.
@Mpdreamz, VS Code on Windows 10.
from shellprogressbar.
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: dotnet/vscode-csharp#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.
from shellprogressbar.
Related Issues (20)
- Misleading documentation of CollapseWhenFinished property
- ProgressBar.WriteLine does not work correctly on multiline writes or when lines are longer then ConsoleWidth HOT 3
- Progress Bar Blocks Cancel Request (CTRL+C)
- Zero String Allocations?
- Update child progress bar message
- Calc character width correct HOT 2
- CollapseWhenFinished except on error
- ProgressBar.WriteLine doesn't show recent messages HOT 4
- Some bars disappear as console scrolls HOT 3
- Support to Int64 values of newTickCount and maxTicks HOT 1
- Multiple bars broke view in parallel HOT 1
- async Task await breaks progress bar
- Output not updating until function end
- Tick(estimatedDuration, message) does not update EstimatedDuration
- Progress not staying on one line HOT 1
- Update NuGet package license as equal as GitHub MIT license HOT 1
- Can we have Spawn with IndeterminateProgressBar as a child would be good. HOT 1
- EstimatedDurationString "overflows" if EstimatedDuration exceeds 24 hours
- Exemple error
- [Feature] Spawn child progress as indeterminate progress bar
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shellprogressbar.