Code Monkey home page Code Monkey logo

Comments (8)

theamazingfedex avatar theamazingfedex commented on September 10, 2024

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.

dlech avatar dlech commented on September 10, 2024

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.

jakehockey10 avatar jakehockey10 commented on September 10, 2024

I'm seeing this same error while using the Powershell terminal in VS Code. Does that change the assessment of this issue?

from shellprogressbar.

Mpdreamz avatar Mpdreamz commented on September 10, 2024

Please try: https://www.nuget.org/packages/ShellProgressBar/4.1.1 it works for me in the Bash on Windows terminal.

from shellprogressbar.

jamesrom avatar jamesrom commented on September 10, 2024

@Mpdreamz, this issue still occurs when using Visual Studio Code. Tested with 4.1.1.

from shellprogressbar.

Mpdreamz avatar Mpdreamz commented on September 10, 2024

@jamesrom what operation system do you use?

from shellprogressbar.

jamesrom avatar jamesrom commented on September 10, 2024

@Mpdreamz, VS Code on Windows 10.

from shellprogressbar.

sakennedy avatar sakennedy commented on September 10, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.