git-istage: Unhandled Exception on Windows 7

Hello @terrajobst

I have installed the tool via this command dotnet tool install git-istage -g and I get the following error when running the git istage command, or git istage .:

Unhandled Exception: System.IO.IOException: The handle is invalid
   at System.ConsolePal.get_CursorVisible()
   at GitIStage.Application.Run() in /home/vsts/work/1/s/src/git-istage/Application.cs:line 33
   at GitIStage.Program.Main() in /home/vsts/work/1/s/src/git-istage/Program.cs:line 32

I just created a folder and within that, I have created a new git repository by caling git init, then added a simple txt file and add Hello World text inside that. then I ran git istage . and I get the above mentioned error.

  • worth to note that I am running Windows 7

and here is my dotnet --info output

.NET Core SDK (reflecting any global.json):
 Version:   2.1.403
 Commit:    04e15494b6

Runtime Environment:
 OS Name:     Windows
 OS Version:  6.1.7601
 OS Platform: Windows
 RID:         win7-x64
 Base Path:   C:\Program Files\dotnet\sdk\2.1.403\

Host (useful for support):
  Version: 2.1.5
  Commit:  290303f510

.NET Core SDKs installed:
  2.1.402 [C:\Program Files\dotnet\sdk]
  2.1.403 [C:\Program Files\dotnet\sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.1.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.1.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
  https://aka.ms/dotnet-download

About this issue

  • Original URL
  • State: open
  • Created 6 years ago
  • Comments: 19 (4 by maintainers)

Most upvoted comments

@shahabganji Ah, funny. Works in VS Code indeed. That’s really odd…

I just upgraded from 0.2.2 to 0.2.29, and it’s still failing under Git for Windows (using bash as shell), however, the stacktrace is now:

Unhandled Exception: System.IO.IOException: The handle is invalid
   at System.ConsolePal.set_CursorVisible(Boolean value)
   at GitIStage.Application.Run() in /home/vsts/work/1/s/src/git-istage/Application.cs:line 86
   at GitIStage.Program.Main() in /home/vsts/work/1/s/src/git-istage/Program.cs:line 32

Which makes sense, as usage of get_CursorVisible was removed in 9b9814e, however, set_CursorVisible is still there on L106.

@shahabganji I’ll check tomorrow on my Windows box.

@shahabganji Does the command $ git-istage even work (so without having git invoking istage)? Since that might be an issue with .NET Global tools. I have the same on ZSH. I have solved that by following @gabrielrb approach.

When I then run istage, from a git repository, I still get this (and mine issue #9).