diff --git a/crates/brush-core-vendored/src/interp.rs b/crates/brush-core-vendored/src/interp.rs index 5143dacfa..408182333 100644 --- a/crates/brush-core-vendored/src/interp.rs +++ b/crates/brush-core-vendored/src/interp.rs @@ -2167,10 +2167,12 @@ fn setup_process_substitution( // // We keep the `F_SETPIPE_SZ` fast path for Linux (avoids a thread spawn // for the common in-process case) but fall through to a detached writer -// thread on every other platform, and on Linux when the kernel rejects -// the requested size (body > `pipe-max-size`). The thread owns the -// writer; it terminates naturally when the consumer drains the pipe or -// drops the reader (`BrokenPipe`), so no `JoinHandle` is retained. +// thread on every other platform with OS threads, and on Linux when the +// kernel rejects the requested size (body > `pipe-max-size`). The thread +// owns the writer; it terminates naturally when the consumer drains the +// pipe or drops the reader (`BrokenPipe`), so no `JoinHandle` is retained. +// Targets without OS thread support keep upstream's synchronous write path +// so heredocs continue to work there instead of failing at thread spawn. fn setup_open_file_with_contents(contents: &str) -> Result { let (reader, mut writer) = std::io::pipe()?; let bytes = contents.as_bytes(); @@ -2191,20 +2193,28 @@ fn setup_open_file_with_contents(contents: &str) -> Result ~4 KiB) or macOS (bodies > 16-64 KiB). Root cause was in the embedded brush shell; see `@oh-my-pi/pi-natives` changelog for the underlying fix. ## [15.3.2] - 2026-05-25 ### Added @@ -141,8 +142,6 @@ - Fixed parsing of inline `|TEXT` payloads containing whitespace on `»` and `«` inserts, which previously failed with unrecognized-op errors - Fixed anchored insert handling so an inline `|TEXT` body matching the anchor line is treated as anchor decoration and no longer inserted as a duplicate -- Fixed clipboard image paste (Ctrl+V) silently failing on WSL2 by routing image reads through a `powershell.exe` bridge when WSL interop is detected, since `arboard` returns `ContentNotAvailable` under WSLg ([#1280](https://github.com/can1357/oh-my-pi/issues/1280)) -- Fixed the `bash` tool hanging until the 305 s hard timeout when a command writes a file via heredoc on Windows (bodies > ~4 KiB) or macOS (bodies > 16-64 KiB). Root cause was in the embedded brush shell; see `@oh-my-pi/pi-natives` changelog for the underlying fix. ## [15.3.0] - 2026-05-25 diff --git a/packages/natives/CHANGELOG.md b/packages/natives/CHANGELOG.md index acf9440a8..8b65463d8 100644 --- a/packages/natives/CHANGELOG.md +++ b/packages/natives/CHANGELOG.md @@ -2,14 +2,15 @@ ## [Unreleased] +### Fixed + +- Fixed bash heredocs (`<<`) and here-strings (`<<<`) deadlocking the shell on Windows past ~4 KiB and on macOS past 16-64 KiB. `brush_core::interp::setup_open_file_with_contents` wrote the entire body into an anonymous pipe synchronously before handing the reader to the next command; once the body exceeded the OS pipe buffer the writer blocked forever and the `bash` tool timed out at the hard 305 s ceiling without ever launching the consumer. The Linux fast path still uses `F_SETPIPE_SZ` to grow the pipe in-place; every other OS-threaded platform (and Linux bodies above `pipe-max-size`) now decouples the write onto a fire-and-forget thread that terminates naturally on drain or `BrokenPipe`; no-thread targets keep the upstream synchronous path so heredocs do not fail at thread spawn. + ## [15.3.2] - 2026-05-25 ### Fixed - Fixed `matchesKey` claiming `ctrl+m`/`ctrl+j`/`ctrl+i`/`ctrl+h`/`ctrl+[` for the single bytes terminals emit for Enter/Tab/Backspace/Escape in legacy mode. Pressing Enter no longer triggers a `ctrl+m` binding; the named keys now own those bytes and the colliding `ctrl+` combinations only match when the terminal disambiguates via the Kitty keyboard protocol or `modifyOtherKeys`. The same gate now also applies to `ctrl+alt+` legacy `ESC + ` sequences (e.g. `\x1b\r` is Alt+Enter, not Ctrl+Alt+M). ([#1354](https://github.com/can1357/oh-my-pi/issues/1354)) -### Fixed - -- Fixed bash heredocs (`<<`) and here-strings (`<<<`) deadlocking the shell on Windows past ~4 KiB and on macOS past 16-64 KiB. `brush_core::interp::setup_open_file_with_contents` wrote the entire body into an anonymous pipe synchronously before handing the reader to the next command; once the body exceeded the OS pipe buffer the writer blocked forever and the `bash` tool timed out at the hard 305 s ceiling without ever launching the consumer. The Linux fast path still uses `F_SETPIPE_SZ` to grow the pipe in-place; every other platform (and Linux bodies above `pipe-max-size`) now decouples the write onto a fire-and-forget thread that terminates naturally on drain or `BrokenPipe`. ## [15.0.2] - 2026-05-15