Nushell
Get Nu!
Getting Started
  • The Nushell Book
  • Command Reference
  • Cookbook
  • Language Reference Guide
  • Contributing Guide
Blog
  • English
  • 中文
  • Deutsch
  • Français
  • Español
  • 日本語
  • Português do Brasil
  • Русский язык
GitHub
Get Nu!
Getting Started
  • The Nushell Book
  • Command Reference
  • Cookbook
  • Language Reference Guide
  • Contributing Guide
Blog
  • English
  • 中文
  • Deutsch
  • Français
  • Español
  • 日本語
  • Português do Brasil
  • Русский язык
GitHub

Nushell 0.97.1

Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your command line. 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 command line pipelines.

Today, we're releasing version 0.97.1 of Nu. This release makes parsing of assignments more consistent, enhances path completions, and includes many enhancements to commands.

Note: this was going to be version 0.97.0, but that version had to be yanked due to a last minute bug. This is still the next major version, not a patch release.

Where to get it

Nu 0.97.1 is available as pre-built binaries or from crates.io. If you have Rust installed you can install it using cargo install nu.

As part of this release, we also publish a set of optional plugins you can install and use with Nu. To install, use cargo install nu_plugin_<plugin name>.

Table of content

  • Highlights and themes of this release
    • More consistent parsing of assignment
    • Enhancements to path completions
  • Changes to commands
    • Additions
      • random binary
      • mv --update
      • print --raw
      • polars save
      • multipart/form-data
    • Breaking changes
      • ps
      • ls
      • stor
      • save
      • polars open
    • Removals
      • polars to-*
    • Bug fixes and other changes
      • const math commands
      • glob accepts globs
      • into datetime
      • reduce
      • split words
      • query web
  • All breaking changes
  • Notes for plugin developers
    • Interrupt signals for plugins
    • Pipeline metadata added to protocol
  • Hall of fame
  • Full changelog

Highlights and themes of this release [toc]

More consistent parsing of assignment [toc]

Breaking change

See a full overview of the breaking changes

The assignment operators and const have been changed (#13385) to better reflect the behavior used by let and mut. Before 0.97, these two statements would have been interpreted very differently:

mut num = 2 | $in * 4
# equivalent to: mut num = (2 | $in * 4)
$num = 2 | $in * 4
# equivalent to: ($num = 2) | $in * 4

Because assignment operators were parsed just like any other operator, they didn't absorb the rest of the pipeline or run commands the same way that let and mut do, so parentheses were often necessary. This has been changed so that the latter example is now equivalent to $num = (2 | $in * 4) instead. The following are also now all possible, and would have been errors before:

# $path will be set to 'a/b'
const path = 'a' | path join 'b'

mut x = 2
# $x will be set to a random integer
$x = random int
# $x will be set to 6
# previously `math sum` would have received nothing input
$x = [1 2 3] | math sum

# $env.FOO will be set to a random string
$env.FOO = random chars

However, this also introduces a pretty major breaking change. The following would have set variables to strings before:

const foo = bar # 'bar'
$quux += baz # appends 'baz'
$env.FOO = `C:\foo\bar\baz.exe`

With the new change, these would all be interpreted as commands instead. To try to make this less surprising, we have decided to require the caret (^) to be used when invoking external commands from a bare word on the right hand side of an assignment (alone, not within parentheses). Failing to use the caret causes a parse error. If you intend to run the command, simply add the caret:

$env.FOO = ^`C:\foo\bar\baz.exe`

Otherwise, consider using a type of string that doesn't cause command execution:

$env.FOO = 'C:\foo\bar\baz.exe'

Enhancements to path completions [toc]

Breaking change

See a full overview of the breaking changes

Thanks to @lavafroth in #13302, path completions now explicitly check for and prefer an exact match for a basename instead of longer or similar names.

Also, thanks to @lyuha in #13321, when completing paths on Windows, the last path separator in use will now be preserved. If the path was most recently using forward slashes, the completion will suggest a forward slash, but if it was using backslashes (as is conventional for Windows), it will continue to suggest backslashes. This should make things a bit more ergonomic for those who prefer to use forward slashes on Windows.

Changes to commands [toc]

Additions [toc]

random binary [toc]

Thanks to @KAAtheWiseGit in #13542, the random binary command was added. This command has one required parameter which is the number of bytes to generate.

> random binary 16
Length: 16 (0x10) bytes | printable whitespace ascii_other non_ascii
00000000:   28 99 b7 0e  c0 2f 02 0c  d8 5a b9 69  72 36 86 30   (×ו×/•_×Z×ir6×0

mv --update [toc]

In #13505, @Embers-of-the-Fire added the --update/-u flag to mv. This has the same behavior/purpose as the --update flag on cp. Namely:

move and overwrite only when the SOURCE file is newer than the destination file or when the destination file is missing

print --raw [toc]

In #13597, the --raw flag was added to print. This will bypass any pretty formatting from table and instead write data directly to stdout or stderr.

polars save [toc]

The polars sink and polars to-* commands have been merged (#13568) into a single command, polars save. This change helps to choose the most efficient option possible for lazyframes, allowing them to stream out to disk when supported.

multipart/form-data [toc]

In #13532, thanks to @weirdan, the http post command now supports the multipart/form-data content type.

Breaking changes [toc]

ps [toc]

Thanks to @qfel, after #13618, the name column from the ps command will now contain the name of the process instead of its path.

ls [toc]

After #13479, the --full-paths/-f flag for ls will cause the paths in the target column to be fully qualified paths.

stor [toc]

Thanks to @maxim-uvarov in #13464, stor no longer implicitly removes ansi escape sequences from strings that will be stored.

save [toc]

Streams from external commands will now (#13422) have their stderr printed to nu's stderr, if captured but not used.

polars open [toc]

polars open will now open a lazyframe by default (#13556). The --lazy option has been removed, and --eager has been added instead, to explicitly open an eager dataframe.

Removals [toc]

polars to-* [toc]

The polars to-* commands have been superseded by polars save.

Bug fixes and other changes [toc]

const math commands [toc]

In #13566, @Qnbie has made more math commands usable in constant evaluation:

  • math abs
  • math avg
  • math ceil
  • math floor
  • math log
  • math max
  • math median
  • math min
  • math mode
  • math product
  • math round
  • math stddev
  • math sqrt (#13487)
  • math sum
  • math variance

glob accepts globs [toc]

After #13612, glob now also takes globs (in addition to strings) as the first parameter.

into datetime [toc]

Thanks to @NotTheDr01ds in #13541, integer values can now be piped into into datetime in combination with a format string. The integers will be interpreted based on the format string. Example:

1724112000 | into datetime -f '%s'
# => Tue, 20 Aug 2024 00:00:00 +0000 (now)

reduce [toc]

Thanks to @Bahex in #13461, the accumulator argument is now also passed as pipeline input to the closure provided to reduce.

split words [toc]

Thanks to @weirdan in #13502, split words no longer removes digits and instead treats them as part of a word.

query web [toc]

Thanks to @Embers-of-the-Fire, some potential panics for query web were fixed in #13507.

Additionally, thanks to @jameschensmith in #13538, an issue with values appearing in the wrong column due to missing data was fixed.

All breaking changes [toc]

  • #13618 Prefer process name over executable path
  • #13568 Merge polars sink and polars to-* to polars save
  • #13556 polars open will now open a lazy frame by default
  • #13302 feat: prefer exact match when completion mode is prefix
  • #13422 save: print to stderr for bytestream
  • #13385 Make assignment and const consistent with let/mut
  • #13464 don't force stripping ansi codes from strings in stor
  • #13181 feat: make ctrlc available to plugins

Notes for plugin developers [toc]

Interrupt signals for plugins [toc]

Interrupt (ctrl-C) signals are now available to plugins, thanks to @cablehead in #13181. The EngineInterface::register_signal_handler method is used to set up a handler for interrupt & clear signals. A new plugin input message, Signal, has been added to support this functionality. For non-Rust plugins, please be sure to add support for this message as appropriate.

Pipeline metadata added to protocol [toc]

The metadata of PipelineData has been added to the protocol in #13495, ensuring that metadata can be preserved across plugin calls, or used by plugins as appropriate.

This required some pretty significant changes to PipelineDataHeader, with Value now being a tuple variant, and the ListStreamInfo and ByteStreamInfo now containing metadata fields. Non-Rust plugins will definitely need to be updated to be compatible with this change. Please check that your plugins conform to the updated documentation. There are no API changes to nu-plugin required, so Rust plugins should just need to be recompiled.

Hall of fame [toc]

Thanks to all the contributors below for helping us solve issues and improve documentation 🙏

authortitlePR
@ysthakurFix bug introduced by #13595#13658
@fdncredadd more helpful error with text/xml#13609
@WindSoildermake ls -lf outputs full path in symbolic target#13605
@ysthakurParse time type checking for range#13595
@sholderbachInclude only *.nu files in the vendor autoload#13599
@jameschensmithInclude empty table data cells in query web tables#13538
@Embers-of-the-FireFix overflow table display in command documentation#13526
@Embers-of-the-FireFix internal panic for query web#13507

Full changelog [toc]

  • ayax79 created
    • bumped version number to 0.97
    • Incrementing the eager dataframe cache value before returning it
    • Merge polars sink and polars to-* to polars save
    • Added polars sink command, that performs and streaming collect to t…
    • polars first and polars last will now handle lazy frames natively
    • polars open will now open a lazy frame by default
    • Attempt to guess the content type of a file when opening with --raw
    • Adding plist support
    • Make pipeline metadata available to plugins
    • setting content type metadata on all core to * commands
  • IanManske created
    • Fix clippy lints
    • Path migration part 4: various tests
    • Path migration part 3: $nu paths
  • weirdan created
    • Drop outdated touch -d example
    • Drop unused fs_extra and hamcrest2 dependencies
    • Fallback to extension-based content type detection when parsing Content-Type header fails
    • Add multipart/form-data uploads
    • Consider numbers to be part of a word in split words
    • Links to security contacts
  • fdncred created
    • update to latest reedline f2b4
    • add osc633e
    • create a better error message for bad glob patterns
    • allow glob to take a glob or a string as the input
    • add more helpful error with text/xml
    • update to latest reedline commit 919292e
    • make math sqrt const
  • qfel created
    • Prefer process name over executable path
    • Fix handling of spaces in executable names
    • Clean up key event handling
    • Factor out style-setting code
    • Use the Default implementation of Suggestion
  • sholderbach created
    • Remove code duplication in glob
    • Include only *.nu files in the vendor autoload
    • Bump typo with new ignore
    • Rework help generation internals
    • Fixup #13526 width flag for example
    • Replace manual Record::get implementation
    • Lift SharedCow::to_mut out of if let branches
    • Simplify column look-up in default
    • Contentious clippy fixes
    • Clippy fixes from stable and nightly
    • Bump rust toolchain
    • Clippy fixes for toolchain bump
    • Create security policy
  • app/dependabot created
    • Bump indexmap from 2.3.0 to 2.4.0
    • Bump shadow-rs from 0.30.0 to 0.31.1
    • Bump sysinfo from 0.30.11 to 0.30.13
    • Bump mockito from 1.4.0 to 1.5.0
    • Bump quick-xml from 0.31.0 to 0.32.0
    • Bump scraper from 0.19.0 to 0.20.0
    • Bump indexmap from 2.2.6 to 2.3.0
    • Bump similar from 2.5.0 to 2.6.0
    • Bump crate-ci/typos from 1.23.3 to 1.23.5
    • Bump shadow-rs from 0.29.0 to 0.30.0
    • Bump openssl from 0.10.64 to 0.10.66
    • Bump crate-ci/typos from 1.23.2 to 1.23.3
    • Bump softprops/action-gh-release from 2.0.6 to 2.0.8
  • WindSoilder created
    • make ls -lf outputs full path in symbolic target
    • support SyntaxShape::OneOf in named args
    • save: print to stderr for bytestream
  • ysthakur created
    • Fix bug introduced by #13595
    • Parse time type checking for range
    • Add completions.sort option
  • Aakash788 created
    • FIX : Only home dir path in pwd will be replaced with ~ in in titlebar
  • playdohface created
    • Make error-message more helpful when user invokes a non-executable file (#13477)
  • devyn created
    • Add --raw switch to print for binary data
    • Add parse error for external commands used in assignment without caret
    • Make assignment and const consistent with let/mut
    • Bump version to 0.96.2
  • Qnbie created
    • Make the math commands const
  • NotTheDr01ds created
    • Add type signature example for def command
    • Allow int input when using a formatstring in into datetime
    • Clarify default command help
    • Doc and examples for multi-dot directory traversal
    • random chars doc clarifications
    • Clarify random int help
    • Update query-web example to use new chunks
  • kurokirasama created
    • chore: Add nu_plugin_polars to build and install scripts
  • KAAtheWiseGit created
    • Fix a typo in an example
    • Create random binary command
  • cablehead created
    • fix: relay Signals reset to plugins
    • feat: make ctrlc available to plugins
  • jameschensmith created
    • Include empty table data cells in query web tables
  • lavafroth created
    • feat: prefer exact match when completion mode is prefix
  • Embers-of-the-Fire created
    • Fix overflow table display in command documentation
    • Fix internal panic for query web
    • Add --upgrade switch for mv command
  • maxim-uvarov created
    • don't force stripping ansi codes from strings in stor
  • Bahex created
    • reduce: supply <acc> to the closure as pipeline input as well
  • suimong created
    • Add "--as-columns" flag to polars into-df
  • userwiths created
    • fix: Make log respect use_ansi_coloring setting.
  • lyuha created
    • Keep forward slash when autocomplete on Windows
Edit this page on GitHub
Contributors: Ian Manske, NotTheDr01ds, Devyn Cairns, fdncred, Lars Francke