Skip to content

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
@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.

4 participants