Brush Shell 0.4.0 Enhances Bash Compatibility and Cross-Platform Support
The Rust-based shell Brush has released version 0.4.0, introducing major improvements to bash compatibility, expanded platform support, and refined arithmetic handling.

The Rust-based shell Brush has reached version 0.4.0, marking a significant milestone in its development with over 200 pull requests merged to improve bash compatibility and platform support Help Net Security. Designed as a modern, memory-safe alternative to traditional Unix shells, the latest release focuses on closing long-standing functional gaps that previously hindered its ability to execute complex bash scripts accurately.
A primary focus of this release is the alignment of Brush’s behavior with standard bash expectations. The maintainers have implemented critical features such as set -e (errexit) and pipefail, complete with the specific exemption rules historically found in bash. Furthermore, the shell now supports the set -u (nounset) option, which triggers errors on unset variable references, and the failglob option, which treats non-matching globs as errors. The update also introduces support for coproc and ensures that unknown command-line options return an exit code of 2, mirroring bash’s behavior Help Net Security.
Arithmetic operations have undergone extensive refinement, addressing high-radix literals, overflow and underflow handling, and the legacy $[expr] syntax. The update also improves the reliability of heredocs within command substitutions and quoted contexts. Several built-in commands, including caller, read, mapfile -O, getopts, compgen -A, and printf %q, have been expanded or corrected. The maintainers explicitly note that scripts that previously executed without issue in version 0.3.0 may now fail if they contain errors that bash would also identify, a change intended to enforce stricter compatibility Help Net Security.
Beyond core functionality, Brush 0.4.0 significantly expands its platform reach. The shell now supports use as a login shell on macOS following a fix for a startup hang, and Windows path handling has been overhauled with the addition of /dev/null emulation. The project has also restored FreeBSD builds and ensured clean compilation for Android and 32-bit targets. While Windows support remains experimental, the inclusion of a new build flag allows users to bundle coreutils built-ins into a single binary, which is particularly useful for containerized and embedded environments Help Net Security.
For interactive users, the update introduces an opt-in TOML configuration file located at ~/.config/brush/config.toml and adds Zsh-style preexec and precmd hooks behind an experimental flag. Terminal integration has been enhanced through semantic prompt and command marking, and Readline macro support has been improved to better accommodate inputrc configurations used by tools like starship, atuin, and fzf Help Net Security.
This release underscores the growing trend of rewriting foundational Unix utilities in memory-safe languages like Rust to improve security and maintainability. By prioritizing strict bash compatibility, the Brush project aims to provide a drop-in replacement for users who require modern features like syntax highlighting and history-based suggestions without sacrificing the ability to run legacy scripts. Users can access the latest version via GitHub, crates.io, Homebrew, Arch Linux, and Nix Help Net Security.