Nushell 0.28
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.28 of Nu. In this release we've added new commands for working with tables, paths, and lots of general feature improvements.
Where to get it
Nu 0.28 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
.
If you'd like to try the experimental paging feature in this release, you can install with cargo install nu --features=table-pager
.
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 commands
Rotate (andrasio)
With the new rotate
command, we have an easier way to turn rows to columns and columns to rows.
> echo [[col1, col2, col3]; [cell1, cell2, cell3] [cell4, cell5, cell6]] | rotate
───┬─────────┬─────────┬─────────
# │ Column0 │ Column1 │ Column2
───┼─────────┼─────────┼─────────
0 │ cell4 │ cell1 │ col1
1 │ cell5 │ cell2 │ col2
2 │ cell6 │ cell3 │ col3
───┴─────────┴─────────┴─────────
You can also rotate counter-clockwise:
> echo [[col1, col2, col3]; [cell1, cell2, cell3] [cell4, cell5, cell6]] | rotate counter-clockwise
───┬─────────┬─────────┬─────────
# │ Column0 │ Column1 │ Column2
───┼─────────┼─────────┼─────────
0 │ col3 │ cell3 │ cell6
1 │ col2 │ cell2 │ cell5
2 │ col1 │ cell1 │ cell4
───┴─────────┴─────────┴─────────
Column rolling (andrasio)
You are now able to move columns around in the same way you may do a bitwise-rotate.
> echo '00000100'
| split chars
| each { str to-int }
| rotate counter-clockwise _
| reject _
| rename bit1 bit2 bit3 bit4 bit5 bit6 bit7 bit8
| roll column 3
───┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────
# │ bit4 │ bit5 │ bit6 │ bit7 │ bit8 │ bit1 │ bit2 │ bit3
───┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────
0 │ 0 │ 0 │ 1 │ 0 │ 0 │ 0 │ 0 │ 0
───┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────
Dropping columns (andrasio)
The new drop column
subcommand also gives you the ability to remove the last column from a table.
> echo [[lib, extension]; [nu-core, rs] [rake, rb]] | drop column
─────────
lib
─────────
nu-core
rake
─────────
ANSI strip (fdncred)
With the new ansi strip
command, you can remove ansi sequences from a string of text.
Path joining (kubouch)
We now have a path join
command which allows you to join part of a path to an existing path following the path conventions for your platform.
For example, on Windows:
> echo 'C:\Users\viking' | path join spam.txt
Or Unix-based systems:
> echo '/home/viking' | path join spam.txt
Functionality
(Experimental) Built-in table paging (rezural)
If you build Nushell with the optional --features=table-pager
you'll see some new capabilities we're working on that will let you view a table with a built-in pager.
In the future, we'll likely move this to its own command so that you can enable paging in much the same way you would use less
in other shells.
Let us know how this works for you.
Timing your pipelines (fdncred)
You can now see the time spent in the last set of commands you sent to Nushell by checking the new $nu.env.CMD_DURATION
environment variable.
This will let you, for example, add timings to your prompts for all your fancy prompt needs.
Improved matches (ilius, kubouch)
The match
command has a few new flags to give you more control over how you'd like to match text.
You're now also able to invert the match.
Fetch now uses the latest surf and rustls (fdncred)
We're experimenting with moving away from openssl for some commands. In this release, we've moved fetch
to use the latest surf, which gives us the ability to use rustls instead of openssl. Please try this out and let us know how it works for you.
Cleaner help output (kubouch)
We've cleaned up the help, so that there's now a difference between the synopsis for a command and its full help text. This makes help commands
output a table that's much easier to read.
JSON order is now preserved, again (andrasio)
We previously supported preserving the order of fields of JSON when serialized and deserialized, but as we changed and updated dependencies we lost this ability.
In this release, it's been re-added so that fields will preserve order once again.
Exit codes (tiffany352)
The exit
command can now optionally take an exit code, allowing you to quit a nushell with an exit code that can be detect outside of the shell.
VSCode extension is now published (fdncred)
VSCode users can now use the VSCode extension for Nushell right from the VSCode marketplace!
Internal
- Improved tests for nu-env (andrasio)
- We now remove the current directory (
.
) from paths where possible (iCodeSometime) - We've begun a multi-step process of simplifying how tables are rendered. The first step is to convert drawing table to return strings (rezural).
- We've vendored an ansi term crate to make it easier to improve. This helped make 'Light' colors easier to reach. (fdncred)
- We've removed some unnecessary dependencies (stormasm)
- Some general improvements to parser logic (ilius)
- Some crashes in
flatten
and docs were fixed (stormasm) - We're now using the host for output rather than
std::err
for better portability. (LhKipp) - Improved ergnomics when working with $nothing (fdncred)
- Fixed some locking logic when working with output (ahkrr)
- Bel and backspace are now part of
char
(fdncred) - Trash functionality has been fixed (tw4452852)
- Today's crates.io release was also fully automated, thanks to Nushell (sophiajt)
Documentation
- Instructions for building and running the website locally (jakevossen5)
- Updates to the docker instructions (jakevossen5)
- Improvements to the environment documentation (stormasm)
- Fixed typo in the textview docs (davidmalcolm)
- Corrected Nushell version in excerpt (iCodeSometime)
- Fixed a typo in the PowerShell comparison (JTurtl3)
Looking ahead
We're continuing our 1.0 planning and hope to publish a proposal soon for your feedback. There are also some on-going experiments, including a new line editor that are offering good insights into better ways of working with the terminal.
And, of course, we hear the feedback about improving completions. We're very much interested in beginning experiments here that will lead to a far better experience as we approach 1.0.