Code Monkey home page Code Monkey logo

Comments (3)

Barokai avatar Barokai commented on July 30, 2024 1

Having the same issue on Windows 11, with PowerShell 7.2.7 and cmd.exe in Windows Terminal.
Using Scalingo Client version 1.26.0

from cli.

EtienneM avatar EtienneM commented on July 30, 2024

Cross post with the following issue: golang/go#34612 (comment)


We are facing the same issue but found out something slightly odd. First, we use the new golang.org/x/term package rather than x/crypto/ssh/terminal as mentioned in the title of this issue.

We face the same issue as described in this issue in Git Bash. The code is here: https://github.com/Scalingo/cli/blob/master/term/password.go#L13

But if we run Git Bash from within the terminal tab of VS Code, we no longer face the same issue, everything works as expected.

Does anyone know what is the difference between Git Bash and Git Bash inside VS Code?

I uploaded the smallest example which reproduces the issue here: https://github.com/EtienneM/mwe_read_password/blob/master/main.go

I'm not exactly sure about what information may be needed. My OS version:

C:\Users\Administrator>systeminfo | findstr /B /C:"OS Name" /C:"OS Version"

OS Name:                   Microsoft Windows Server 2019 Datacenter
OS Version:                10.0.17763 N/A Build 17763

The Go version:

C:\Users\Administrator>go version
go version go1.19.2 windows/amd64

The golang.org/x/term version is:

$ cat go.mod | grep "golang.org/x/term"
require golang.org/x/term v0.0.0-20220919170432-7a66f970e087

With this example, in Git Bash in VS Code I can type a password and the output is:

$ go build && ./mwe.exe
<nil>

In Git Bash outside of VS Code, I can't type the password and immediately get the error:

$ go build && ./mwe.exe
The handle is invalid.

from cli.

EtienneM avatar EtienneM commented on July 30, 2024

A workaround could be to disable the regions cache on Windows.

from cli.

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.