util: handle stty failures under mingw for getpass workaround#1081
Merged
util: handle stty failures under mingw for getpass workaround#1081
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When operating in a MinGW terminal without invoking
winpty, getpass does not function as expected. This extension included a workaround by usingstty; 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 withwinptyto prevent issues when using the ask-password capability.