Skip to content
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

fix(cli): always disable interactive mode in non-TTYs #6419

Merged
merged 2 commits into from
Jul 29, 2024

Conversation

paul-soporan
Copy link
Member

What's the problem this PR addresses?

When preferInteractive is set to true, yarn {add,up} are interactive even outside TTYs, which is unintended.

Can be checked by running yarn add lodash > foo.txt in our repository.

How did you fix it?

Made it disable interactivity when stdout isn't a TTY (and added a new configuration.isInteractive helper).

Checklist

  • I have set the packages that need to be released for my changes to be effective.
  • I will check that all automated PR checks pass before the PR gets reviewed.

const interactive = this.interactive ?? configuration.get(`preferInteractive`);
const interactive = configuration.isInteractive({
interactive: this.interactive,
stdout: this.context.stdout,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it stdin that has to be interactive?

@arcanis arcanis merged commit b41b4fb into master Jul 29, 2024
22 of 26 checks passed
@arcanis arcanis deleted the paul/fix/preferInteractive branch July 29, 2024 08:19
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.

3 participants