Upgrade to Brush Shell 0.4.0 for Enhanced Security and Expanded Compatibility
Brush Shell 0.4.0 Enhancements
Brush, a rust-based alternative to traditional Unix shells, has released version 0.4.0, introducing significant improvements in script safety and platform support.
Script Safety Enhancements
- The
set -efeature, mirroring bash’s exemption rules, has been implemented. set -unow generates an error when encountering unset variable references.- The
failgloboption treats no-match globs as errors. - The
ERR traphas been implemented in conjunction with earlierEXIT trapwork.
Platform Support Improvements
- Coprocess support is now available via the
coproccommand. - A new
--noglobor-fcommand-line flag has been added. - Unknown command-line options now exit with code 2, aligning with bash behavior.
- Arithmetic handling has been refined, including high-radix literals, overflow and underflow behavior, and infinite-recursion detection.
According to the maintainer, scripts running smoothly under v0.3.0 may now terminate with errors produced by bash, which is considered intended behavior.
Interactive Features
- An opt-in TOML configuration file at
~/.config/brush/config.tomlallows for brush-specific settings outside shell scripts. - Zsh-style preexec and precmd hooks are available behind an experimental flag.
- Terminal integration with semantic prompt and command marking can be enabled similarly.
- Readline macro support has been added, with subsequent work addressing real-world inputrc forms.
API Changes
- Embedders can add custom builtins and variable behavior without forking using API changes.
- The Shell type is now generic over a ShellExtensions parameter, providing a hook for embedders.
Brush is freely available on GitHub under the MIT license through crates.io, Homebrew, Arch Linux’s extra repository, and Nix.
