-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Description
Describe the bug
Enabling the auto-prompt feature, eg using AWS_CLI_AUTO_PROMPT=on, breaks non-interactive use of aws, such as invoking from a script.
A couple of related issues, #5317 and #7862, have comments suggesting the use of on-partial, eg using AWS_CLI_AUTO_PROMPT=on-partial, but this is really a workaround.
The AWS CLI should check if it's being invoked interactively, eg checking for a tty, and conditionally disable auto-prompt mode, as you should only ever want that behaviour when running interactively.
Expected Behavior
aws should work correctly non-interactively (eg when invoked from a script) by disabling auto-prompt mode if it's on.
Current Behavior
aws displays the auto-prompt when invoked non-interactively, eg from a script, rather than running the desired command, breaking the script.
Reproduction Steps
Enable auto-prompt mode, using export AWS_CLI_AUTO_PROMPT=on and run any aws command from a script.
Possible Solution
As per description, check for a tty.
Additional Information/Context
No response
CLI version used
aws-cli/2.13.35 Python/3.11.6 Darwin/21.6.0 exe/x86_64
Environment details (OS name and version, etc.)
macOS Monterey 12.7