From 96f761f4bf7c5e98ada9b33ac5c9478d77137c8c Mon Sep 17 00:00:00 2001 From: camc314 <18101008+camc314@users.noreply.github.com> Date: Thu, 12 Mar 2026 13:55:57 +0000 Subject: [PATCH] fix(oxfmt): ensure stdin blocking mode is set for non-TTY environments (#20289) --- apps/oxfmt/src-js/cli.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/oxfmt/src-js/cli.ts b/apps/oxfmt/src-js/cli.ts index 936a71800f10a..4fca3dea4a569 100644 --- a/apps/oxfmt/src-js/cli.ts +++ b/apps/oxfmt/src-js/cli.ts @@ -23,6 +23,8 @@ void (async () => { // See: https://github.com/napi-rs/napi-rs/issues/1630 // @ts-expect-error: `_handle` is an internal API if (!process.stdout.isTTY) process.stdout._handle?.setBlocking?.(true); + // @ts-expect-error: `_handle` is an internal API + if (!process.stdin.isTTY) process.stdin._handle?.setBlocking?.(true); // Call the Rust CLI first, to parse args and determine mode // NOTE: If the mode is formatter CLI, it will also perform formatting and return an exit code