Upgrade to Brush Shell 0.4.0 for Enhanced Security and Expanded Compatibility

www.news4hackers.com-upgrade-to-brush-shell-0-4-0-for-enhanced-security-and-expanded-compatibility-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 -e feature, mirroring bash’s exemption rules, has been implemented.
  • set -u now generates an error when encountering unset variable references.
  • The failglob option treats no-match globs as errors.
  • The ERR trap has been implemented in conjunction with earlier EXIT trap work.

Platform Support Improvements

  • Coprocess support is now available via the coproc command.
  • A new --noglob or -f command-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.toml allows 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.


Blog Image

About Author

en_USEnglish