Skip to content

Releases

v0.6.1

Choose a tag to compare

@sursaone sursaone released this 16 Nov 09:23

Fixed

  • Output written before the first onData listener is no longer lost (#53, #54)
    • bun-pty keeps the newest 512 KiB of UTF-8, cut only between whole characters, and delivers it to the first listener (and any added in the same tick) just after onData() returns
    • Before, a consumer that awaited anything between spawn() and onData() lost the shell's first prompt, or all of a fast command's output
    • A consumer that subscribes in the same tick as spawn() sees no change

Changed

  • The repository moved to sursatech/bun-pty. Old sursaone/bun-pty links and clones redirect.

Thanks to @btriapitsyn for the contribution!

v0.6.0

Choose a tag to compare

@sursaone sursaone released this 30 Oct 06:44

⚠️ Breaking: Bun 1.4.0 or newer is required

bun-pty now uses the engine-native bun:ffi that arrived in Bun 1.4. On an older Bun, importing still works, and spawn() throws bun-pty needs Bun 1.4.0 or newer, but this is Bun 1.3.x. Run \bun upgrade`.`

bun upgrade

The JavaScript API is unchanged. If you build your own native library and point BUN_PTY_LIB at it, rebuild it from this version: the length argument of bun_pty_read and bun_pty_write is now usize.

Changed

  • Bun 1.4's faster FFI (#52)
    • Bun reports FFI calls up to 3x faster in 1.4, and hot call sites are JIT-compiled to direct C calls
    • Reads and writes pass the buffer and its byte length as one view ("buffer" + "buffer_length"), so the two cannot disagree
    • The command line and cwd go to the native library as plain strings
    • Library load failures now include the operating system's dlerror() message
  • README: a section on choosing between bun-pty and Bun's built-in Bun.Terminal

Fixed

  • write("") no longer throws bun:ffi cannot convert argument to 'ptr' on Bun 1.4 (#52)

Internal

  • @types/bun 1.4.4, @types/node 26.6.6, TypeScript 7.0.2, bun.lock v2, and updated Rust crates (portable-pty stays at 0.8.1 because of wezterm/wezterm#6783)
  • GitHub Actions on their current major versions, no persisted checkout credentials in the publish workflow, CI on Alpine 3.24 and on Bun 1.4.0, and a bun check type check

v0.5.2

Choose a tag to compare

@sursaone sursaone released this 26 Oct 04:52

Fixed

  • A native library that fails to load now gets a clear error (#51)
    • spawn() throws bun-pty could not load its native library at <path>: <dlopen error> instead of undefined is not an object (evaluating 'lib.symbols')
    • Importing bun-pty no longer throws when no library file is found either; the error comes from spawn(), and the load failure is still logged at import
    • Typical cause: a bun build --compile binary for musl that shipped the glibc library

Thanks @cat-miaw for the fix.

v0.5.1

Choose a tag to compare

@sursaone sursaone released this 12 Oct 06:44

Fixed

  • Test files are left out of the npm package (#50)
    • "files" in package.json lists all of src, and npm does not apply .npmignore patterns to the paths it lists, so earlier tarballs included the src/*.test.ts files
    • No code changes since 0.5.0. See the 0.5.0 notes for the env change

v0.5.0

Choose a tag to compare

@sursaone sursaone released this 12 Oct 05:31

⚠️ Breaking: env replaces the child's environment

env is now the child's whole environment, as in node-pty, instead of being merged over the parent's. Variables you leave out, such as tokens, no longer reach the child (#47).

If you pass a partial map and rely on inheriting the rest, spread process.env:

spawn("bash", [], { name: "xterm-256color", env: { ...process.env, FOO: "bar" } });

If you already pass { ...process.env, ... } or no env, nothing changes for you.

Changed

  • env replaces the environment (#48)
    • Without env, the child gets the current process.env, so changes made at runtime reach it
    • When the map has no PATH, a bare program name such as sh is still found with the parent's PATH, which does not reach the child
    • On Windows, a map with no entries keeps the parent's environment, as in node-pty
  • The child's environment is built as node-pty builds it on Unix (#49)
    • TERM is set from the name option, which was ignored before, then from TERM in the environment, then "xterm"
    • PWD is set from cwd
    • When the child inherits process.env, the parent's tmux and screen variables (TMUX, STY, ...) and its COLUMNS and LINES are dropped
  • IPtyForkOptions.name is optional, and env: process.env now type-checks (#49)

Thanks to @zgeoff for the report and the contribution!

v0.4.11

Choose a tag to compare

@sursaone sursaone released this 30 Sep 05:53

Added

  • Native Windows ARM64 support (#46)
    • Ships a pre-built rust_pty_arm64.dll (built on GitHub's windows-11-arm runner for aarch64-pc-windows-msvc) alongside the existing x64 rust_pty.dll, whose filename is unchanged
    • Links the MSVC runtime statically (-C target-feature=+crt-static) to avoid a Visual C++ Redistributable dependency
    • Selects the ARM64 DLL at runtime and in the bun build --compile embed path, falling back to rust_pty.dll
    • Adds a windows-11-arm job to the test matrix that runs the unit and integration tests against the exact ARM64 artifact

Thanks to @dakehero for the contribution!

v0.4.10

Choose a tag to compare

@sursaone sursaone released this 15 Jun 11:18

Added

  • musl libc support for Alpine Linux and other musl-based distros (#40)
    • Ships pre-built musl variants (librust_pty_musl.so / librust_pty_arm64_musl.so) alongside the existing glibc builds via cargo-zigbuild with -C target-feature=-crt-static
    • Detects musl at runtime via /proc/self/maps and loads the appropriate .so
    • Adds build-musl-lib + test-musl CI jobs that cross-compile on Ubuntu and run the resulting artifact in alpine:3.23
    • Fixes #39

Thanks to @ncopa for the contribution!

v0.4.9

Choose a tag to compare

@sursaone sursaone released this 07 Jun 12:27

What's Changed

  • chore: add nix flake configuration for reproducible builds by @MBanucu in #36
  • fix(terminal): fix race condition preventing onData listeners from receiving data when set immediately after construction by @MBanucu in #37
  • fix: don't treat transient read errors (EINTR/EWOULDBLOCK) as EOF in the reader thread by @Nibbler1250 in #42

New Contributors

Full Changelog: v0.4.8...v0.4.9

v0.4.8

Choose a tag to compare

@sursaone sursaone released this 15 Jan 19:57
41dd5b8

What's Changed

  • fix: use TextDecoder streaming mode to handle UTF-8 across chunk boundaries by @remorses in #33
  • chore: release v0.4.8 by @sursaone in #34

Full Changelog: v0.4.7...v0.4.8

v0.4.7

Choose a tag to compare

@sursaone sursaone released this 10 Jan 16:19
f4621fd

What's Changed

New Contributors

Full Changelog: v0.4.6...v0.4.7