-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auto-prompt mode breaks non-interactive aws
usage
#8330
Comments
I had a quick poke around to see how easy this would be to fix and noticed that the initial implementation of auto-prompt in #5613 did have checks for TTY (here and here), but they were removed in #5635, which added the I'd say that's still a bug as, by definition, both auto-prompt modes ( |
Hi @joehorsnell thanks for reaching out. Could you elaborate a bit more on why
|
Hi @tim-finnigan - thanks for getting back to me. I do indeed have In answer to your question, what if you wanted to always have auto-prompt for interactive use, but also be able to still use I understand that this might not be deemed a priority to fix and this issue will probably end up getting automatically closed by the stale bot, but it is still a bug, so suggest you leave it labelled as such, even if it get closed as stale or "won't fix". |
Thanks for following up - I think we can keep tracking this for now, it would be good to get further input from the team. There are issues like #8370 where the current behavior could potentially be improved or better documented. |
Hi @tim-finnigan - yep, exactly - #8370 is, as you say, the same problem. To recap, the basic issue is that both variants of the auto-prompt mode ( I don't think it would be too difficult to fix, as per my comment above, the original implementation had much of the required code checks in it. I would potentially have a look at fixing it myself, if I knew that a PR would likely be accepted? |
Describe the bug
Enabling the auto-prompt feature, eg using
AWS_CLI_AUTO_PROMPT=on
, breaks non-interactive use ofaws
, such as invoking from a script.A couple of related issues, #5317 and #7862, have comments suggesting the use of
on-partial
, eg usingAWS_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'son
.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 anyaws
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
The text was updated successfully, but these errors were encountered: