# Nushell 0.22

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.22 of Nu. In this version, we introduce a new flattening command, more math commands, we remove it-expansion, and add a lot of assorted improvements.

# Where to get it

Nu 0.22 is available as pre-built binaries (opens new window) or from crates.io (opens new window). 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

# New functionality

# The flatten command (andrasio)

animation of using the flatten command

New flatten command

There's now a flatten command that can take tables nested inside of the main table and flatten their contents into the main table.

# More math commands (morbatex, gillespiecd, fdncred)

You can now use rounding in math operations:

> echo [1.5 2.3 -3.1] | math ceil
───┬────
 0 │  2
 1 │  3
 2 │ -3
───┴────

> echo [1.5 2.3 -3.1] | math floor
───┬────
 0 │  1
 1 │  2
 2 │ -4
───┴────

> echo [1.5 2.3 -3.1] | math round
───┬────
 0 │  2
 1 │  2
 2 │ -3
───┴────

# Breaking changes

# Remove it-expansion (jonathandturner)

Previously, we treated the $it variable as a special variable that caused a command to iterate over each element in the row, for example ls | echo $it.name would expand to ls | each { echo $it.name }.

While this was handy in small examples, in the general case it became confusing to remember when and how it-expansion would happen.

In this release, we're trying an experiment of removing it-expansion.

Previously:

ls | echo $it.name

Now:

ls | each { echo $it.name }

Or, you can switch to other forms, like:

ls | get name

We're working towards a simpler mental model, where blocks can have parameters, and $it is the name of the parameter if it's not specified.

Please try it out and let us know what you think.

# Improvements

  • New - a seq command for working with sequences (fdncred)
  • bson and sqlite support added to the WiX (fdncred)
  • to md now has a pretty flag (JosephTLyons)
  • ls can now support other number formatting (lucassmmg)
  • Filesize formats can now be changed via config (fdncred)
  • Tables can now have heavy or no borders (fdncred)
  • math eval now supports tau (rjboas)
  • char now has simpler weather emoji (gillespiecd, fdncred)
  • str to-int now takes an optional radix for conversion (gillespiecd)
  • char can now print any unicode character (fdncred)
  • alias now has optional type inference based on the recently accepted RFC (LhKipp)
  • ls will also list inode in -l mode on Unix (gillespiecd)

# Internal improvements (andrasio, jonathandturner, LhKipp, EverlastingBugstopper, JosephTLyons, fdncred, jjshanks)

It's now easier to create column-paths inside of the Nu source, alias got some bugfixes, the parser got some bugfixes, fixed typo in the build message, filesize labels for bytes wasn't showing up (now fixed), internally there are now more helpers for creating the core Value type, bumped the required Rust version, bugfix for ; endings, and remove unneeded comments.

# Looking forward

We're continuing to work to simplify the internal representation, improve the parser, and work to add support for features like block parameters, variables, and, in the future, custom commands.

If you'd like to help out, come by the discord (opens new window) and say hello!