Skip to content

Comments

util: handle stty failures under mingw for getpass workaround#1081

Merged
jdknight merged 1 commit intomainfrom
handle-stty-failures-under-mingw
Feb 1, 2025
Merged

util: handle stty failures under mingw for getpass workaround#1081
jdknight merged 1 commit intomainfrom
handle-stty-failures-under-mingw

Conversation

@jdknight
Copy link
Member

@jdknight jdknight commented Feb 1, 2025

When operating in a MinGW terminal without invoking winpty, getpass does not function as expected. This extension included a workaround by using stty; however, it has been observed in recent environments that stty may fail to run. This would result in an exception and break a user's attempt to perform a publish request.

First, this commit improves the handling when stty fails to invoke as expected (instead of throwing exceptions a user may not understand). Second, if stty, instead of falling back to trying getpass (which seems to always never work in this environment), just stop and report the issue. Users can should always be able to run with winpty to prevent issues when using the ask-password capability.

When operating in a MinGW terminal without invoking `winpty`, getpass
does not function as expected. This extension included a workaround by
using `stty`; however, it has been observed in recent environments that
stty may fail to run. This would result in an exception and break a
user's attempt to perform a publish request.

First, this commit improves the handling when stty fails to invoke as
expected (instead of throwing exceptions a user may not understand).
Second, if stty, instead of falling back to trying `getpass` (which
seems to always never work in this environment), just stop and report
the issue. Users can should always be able to run with `winpty` to
prevent issues when using the ask-password capability.

Signed-off-by: James Knight <git@jdknight.me>
@jdknight jdknight merged commit 78a2603 into main Feb 1, 2025
29 checks passed
@jdknight jdknight deleted the handle-stty-failures-under-mingw branch February 1, 2025 04:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant