Skip to content

refactor(ui): route stdin probes and prompt reads through pkg_io#288

Merged
indaco merged 3 commits intomainfrom
refactor/output-flag-and-stdin-consistency
May 7, 2026
Merged

refactor(ui): route stdin probes and prompt reads through pkg_io#288
indaco merged 3 commits intomainfrom
refactor/output-flag-and-stdin-consistency

Conversation

@indaco
Copy link
Copy Markdown
Owner

@indaco indaco commented May 7, 2026

Description

Aligns the two remaining stdin reads in src/ui/ with the seeded pkg_io so AppCtx.io redirection observes them like every other I/O in the module:

  • confirmTyped now reads via std.Io.File.readStreaming(pkg_io, ...), matching the isTty probe it already routes through pkg_io. Behind a small extracted helper so unit tests can drive the read against a pipe instead of needing a real TTY.
  • The OSC 11 background probe in ui/color reads its response the same way, removing the last std.posix.read(stdin) bypass in the UI layer.

Also pins the quiet/verbose/debug/dry_run/mode/ndjson mutation contract in a comment: these flags are configured by argv parsing before any worker thread spawns, so plain reads/writes stay race-free; future runtime mutators must migrate the flag and its readers to @atomicLoad/@atomicStore (matching post_install_emit next door). Promoting them eagerly cost ~3 KB of code that crossed a Mach-O page boundary into a 16 KB on-disk hit for a race no caller actually produces - a real binary-size regression for a theoretical concern.

Related Issue

  • None

Notes for Reviewers

  • None

@indaco indaco merged commit e0a6cd0 into main May 7, 2026
3 checks passed
@indaco indaco deleted the refactor/output-flag-and-stdin-consistency branch May 7, 2026 14:00
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.

1 participant