Fix hang on invisible tty when using 2FA where prompt=terminal in some edge cases #1184
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.
This implements the fix suggested by @ngyuki in #1054. When using
prompt=terminal
(which we use to support both Linux and Mac using the same workflow and config, withoutosascript
involvement), we used to have a workaround in.aws/config
that would redirect the terminal prompt to stdout in most cases by adding2> $(tty)
to the end of theaws-vault
credential_process
call, like this:With this patch we can remove that redirect and the prompt always shows up, even when called through the SDK via
aws --profile somerole s3 ls
, for example. Also removes the creation of spurious files namednot a tty
whenprompt=terminal
is forced.This expands on #1149 a bit, where instead of just preferring a non-terminal prompt without an active tty it should show up in all cases anyway when specifically requested.