Skip to content

fix(io): wait for delayed stdin under Node - #2748

Closed
obaseyi2 wants to merge 1 commit into
aws:v1.xfrom
obaseyi2:fix/node-delayed-stdin
Closed

obaseyi2 wants to merge 1 commit into
aws:v1.xfrom
obaseyi2:fix/node-delayed-stdin

Conversation

@obaseyi2

@obaseyi2 obaseyi2 commented Nov 3, 2026

Copy link
Copy Markdown

Description

Read process.stdin directly under Node so secret flags wait for piped input that arrives after the command starts. Retain the fd 0 workaround under Bun, where Ink can drain the process stream before the handler reads it.

Adds a Node subprocess regression test that writes to stdin after a delay and checks the resolved value.

Related Issue

Closes #2747

Documentation PR

Not applicable; command syntax and documented behavior are unchanged.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Other (please describe):

Testing

  • I ran bun test
  • I ran the relevant end-to-end tests with bun run test:e2e, or explained why they are not applicable
  • I ran bun run typecheck
  • I ran bun run lint:check
  • I ran bun run format:check
  • I ran bun run build
  • If I modified src/assets/, I updated affected snapshots with bun test <test-file> --update-snapshots and committed them

The src/io/source.test.ts suite passed (15 tests). TypeScript checking passed with tsc --noEmit. AWS end-to-end tests are not applicable because this changes local stdin handling only.

Checklist

  • I have read the CONTRIBUTING document
  • I have added any necessary tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • I have added an appropriate example to the documentation to outline the feature, or no new docs are needed
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@obaseyi2
obaseyi2 requested a review from a team November 3, 2026 09:20
@github-actions github-actions Bot added the size/s PR size: S label Nov 3, 2026
@jariy17 jariy17 mentioned this pull request Nov 3, 2026
16 of 22 tasks
@jariy17

jariy17 commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Thanks for putting this fix together. I tested the original Bun behavior against the repo’s pinned Bun 1.4.0 and confirmed the stdin issue was fixed upstream in oven-sh/bun#33123.

I opened #2750 with an alternative approach. It removes the obsolete fd workaround and tests delayed stdin after importing Ink under both Bun and Node. I’m closing this PR in favor of #2750.

@jariy17 jariy17 closed this Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/s PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stdin secret flags (--bearer-token -, --api-key -, …) fail under Node when input arrives late

2 participants