Nushell 0.26
Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your commandline. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful commandline pipelines.
Today, we're releasing 0.26 of Nu. It's a polish release with lots of improvements.
Where to get it
Nu 0.26 is available as pre-built binaries or from crates.io. If you have Rust installed you can install it using cargo install nu
.
If you want all the goodies, you can install cargo install nu --features=extra
.
As part of this release, we also publish a set of plugins you can install and use with Nu. To install, use cargo install nu_plugin_<plugin name>
.
What's New
Rest support in custom commands (LhKipp, sophiajt)
You can now refer to a rest argument in your custom command:
def my-cmd[...rest:int] {
echo $rest | math sum
}
Elements of the rest are referred to with positions, like $rest.1
for the 2nd position.
Short flags in custom commands (LhKipp)
You can now also added an optional shorthand flag to longhand flags:
def foo [--bar(-b): int] {
echo $bar
}
foo -b 10
foo --bar 10
Improved build times (sophiajt, stormasm)
When building from scratch, you may now notice that Nushell builds slightly faster. This comes from refactoring large crates into smaller crates and replacing some of our support crates with similar crates that compile faster.
Improvements
I hope you like improvements. We got a lot of them this release.
- fdcnred added support for using multi-byte chars as padding, improved ansi and char support, improved the output of
sys
, optimized some regex usage, removedset
from Windows built-ins, added support for comparing a string and a filepath - JosephTLyons removed unnecessary clones and fixed some test macros
- andrasio added column path support to many
str
commands - sophiajt added error checking for bad rows in column paths, added proper flushing of stdout, split nu-cli and nu-engine, treat the startup commands a single script which improves startup times, fixed reading/writing of bigint/bigdecimal
- baoyachi updated shadow-rs support, removed some of the git support that was no longer needed
- kubouch added the --skip flag to
nth
- ahkrr fixed variable scopes for
def
parameters - brightly-salty replaces the dirs/directories supporting crates
- jankeronmes fixed Gitpod tests
- LhKipp fixed a parser bug that prevented invocations and ranges from being parsed correctly, added
def
documentation, updatedalias
docs - DivineGod moved keybinding_path to nu-data
- Gymea fixed the dirs dependency in nu-engine, improved the
help
logic when the command does not have a description, fixedwhich
output for aliases - gillespiecd added the support for reverse ranges
- stormasm refactored nu-cli and split off commands into nu-command
- TrevorAC99 fixed a rust-embed build breakage
Breaking changes
ps
andsys
are now served using a different supporting crate. The functionality difference between the old crate and the new crate may mean a lack of fields that existed before, or different values than before (as it may be calculated differently).- We removed
str set
. This command was one of the first of its style and has since been replaced by more general commands likeupdate
. - Internal architecture: the Primitive case for lines has been removed. Instead, use strings.
- Internal architecture: the Path and Pattern primitives are now called FilePath and GlobPattern respectively.
Looking forward
We've been humbled by the feedback we got on the 0.25 release and appreciate the support. Looking forward, we'll be continuing to polish the features that landed in 0.25 as we prepare for using these features in larger scripts and in custom completion logic.