Skip to content

Fix input with inherited stdin#1232

Open
puneetdixit200 wants to merge 1 commit into
sindresorhus:mainfrom
puneetdixit200:fix-input-inherited-stdin
Open

Fix input with inherited stdin#1232
puneetdixit200 wants to merge 1 commit into
sindresorhus:mainfrom
puneetdixit200:fix-input-inherited-stdin

Conversation

@puneetdixit200
Copy link
Copy Markdown

Fixes #1219

Summary

  • Ignore a singular inherited stdin source when input or inputFile is provided, so explicit input becomes the only stdin source.
  • Preserve explicit multi-source stdin arrays such as ['inherit', 'pipe'].
  • Add nested regression coverage for stdin and stdio forms in async and sync modes.

Tests

  • npm_config_cache=/tmp/execa-npm-cache npx ava test/io/input-option.js --match='*input option ignores*'
  • npm_config_cache=/tmp/execa-npm-cache npx ava test/io/input-option.js test/stdio/native-inherit-pipe.js test/stdio/file-path-main.js
  • npm_config_cache=/tmp/execa-npm-cache npm run lint
  • npm_config_cache=/tmp/execa-npm-cache npm run type
  • git diff --check

@ehmicky ehmicky self-requested a review May 22, 2026 18:31
@ehmicky
Copy link
Copy Markdown
Collaborator

ehmicky commented May 22, 2026

Hi @puneetdixit200,

Thanks a lot!
Perfect PR, nothing to fault! 👍

This is technically a breaking change, so would require a major release.
We should combine the next major release with dropping support for Node 18 and 20.
We should also fix #1233 (run tests on Node 26) as well.

To allow other non-breaking PRs to still be merged until we do the above, then we probably should wait to merge this PR, but mark it as ready to merge.
@sindresorhus Thoughts?

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.

Fix using both stdin: 'inherit' and input options

2 participants