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.103.0

Today, we're releasing version 0.103.0 of Nu. This release adds support for spawning background jobs, attaching attributes to custom commands, official .deb, .apk, and .rpm packages, a number of Vi-mode enhancements, more than 20 new proposed commands in the std-rfc module, and much more.

Where to get it

Nu 0.103.0 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 contents

  • Highlights and themes of this release
    • Support for Background Jobs
    • Official .deb, .rpm, and .apk packages are now available
    • Custom Command Attributes
    • std-rfc Module
    • Completion and LSP enhancements
    • Reedline Vi-mode enhancements
  • Changes
    • Additions
      • attr commands
      • random uuid
      • default --empty
      • Platform-specific char eol
      • into string --group-digits
      • from xml --allow-dtd
      • to yml
      • overlay use completions
      • $env.config.filesize.show_unit
      • Backtraces for Nushell code
      • Startup banner theming
      • Numeric range padding support in str expand
    • Breaking changes
      • split list now keeps empty sublists
      • match no longer executes closures as if they were a block
      • _PROMPT_\* environment variables are no longer inherited_
      • Closure serialization changes
      • Filesize unit formatting
      • External completers are no longer used for internal commands
    • Removals
      • range
      • into bits
      • fmt
    • Bug fixes and other changes
  • Notes for plugin developers
  • Hall of fame
  • Full changelog

Highlights and themes of this release [toc]

Support for Background Jobs [toc]

Thanks to @cosineblast in #14883, Nushell now has long awaited support for background jobs!

The following commands have been added to all platforms:

  • job spawn
  • job list
  • job kill

And on Unix platforms:

  • Ctrl+Z to move a currently running external command into a frozen background job
  • job unfreeze

Job support is considered "experimental" at the moment. We do expect that this feature will be enhanced in the near future and that some functionality will change, likely with breaking changes.

Official .deb, .rpm, and .apk packages are now available [toc]

Over in our Integrations repository, PR #5 adds official support for Debian/Ubuntu (.deb), Red Hat/Fedora/Rocky (.rpm), and Alpine (.apk). See the Installation Guide for details.

Custom Command Attributes [toc]

With #14906, attributes can now be attached to custom commands. This release includes two built-in attributes:

  • @example: Adds an example usage for the command.
  • @search-terms: Adds search terms that can help users discover the command with help --find (or help -f).

Users can add their own attributes which will be available in the structured-data documentation accessible via help commands and scope commands.

Also, the Standard Library and new std-rfc (below) have been updated to use Custom Attributes for their examples. And the test harness has been updated to use a @test attribute to define test cases.

We expect that attributes will be used to enable additional features in future releases.

std-rfc Module [toc]

The Standard Library (std) is a collection of useful additions written in native Nu. #15042 also adds std-rfc, a "proving ground" for proposed additions to the Standard Library. Features in the std-rfc module should be considered experimental while we determine if and when they should be promoted to the Standard Library in a future release. We welcome your feedback on these commands to help us make that decision.

In this first release, std-rfc includes the following proposals:

  • std-rfc/conversions: A set of helper conversions, including into list, columns-into-table, name-values, record-into-columns, and table-into-columns.
  • std-rfc/tables: New commands to select and reject columns and rows based on slices, and a new aggregate command for running calculations on aggregated table data. aggregate is even more useful when paired with group-by --to-table results.
  • std-rfc/kv (key-value store): a module which can easily store and retrieve pipeline (or other) data in an in-memory (session-based) or on-disk (universal) SQLite database. While we expect that Job control will be extended at some point with messaging support, kv can currently be used to retrieve results from a background job (and for many other purposes).
  • std-rfc/clip: clip copy and clip paste commands for interacting with the system clipboard (requires terminal support).
  • std-rfc/str: dedent and unindent commands to remove common (or specified) indentation from multi-line strings.
  • std-rfc/path: Helpers for working with the extension, parent, or stem of a path.

Completion and LSP enhancements [toc]

Thanks to PRs from @blindFS, this release includes quite a few LSP and completion fixes and enhancements.

Reedline Vi-mode enhancements [toc]

This release also includes a number of Vi-mode enhancements with additions to Reedline:

  • From @deephbz

    • Improvements to Visual Mode Selection and Command Consistency (#867)
    • Atomic unified commands for ChangeInside/DeleteInside (#874)
    • "Yank" (copy): (#868)
  • From @thomasschafer

    • o command to swap anchor and cursor (#877)
    • Clear selection when exiting visual mode (#878)

Changes [toc]

Additions [toc]

attr commands [toc]

As part of the new custom command attributes introduced in this release, several attribute commands have been added:

  • attr example: Attach an example to a command's help text.
    @example "double an int"  { 5 | double }   --result 10
    @example "double a float" { 0.5 | double } --result 1.0
    def double []: [number -> number] {
      $in * 2
    }
    # The examples above will be shown in `help double` or `double --help`.
  • attr search-terms: Attach search terms to a command so that it is easier to find using help --find.
  • attr category: Set the command category for a command.

random uuid [toc]

Thanks to @ayamdobhal in #15239, the random uuid command can now also generate v1, v3, v5, and v7 uuids. Previously, only v4 uuids could be generated. To specify the version, pass the -v/--version flag (default is v4). Note that version 1 requires an additional --mac/-m flag to be provided, and versions 3 and 5 require both a --namespace/-n flag and a --name/-s flag.

default --empty [toc]

This release introduces a new --empty flag for the default command (#15223). With this new flag, if the input value is "empty", then the provided default value will be returned. A value is considering "empty" according to the is-empty command, which currently returns true for any of the following:

  • an empty string: ""
  • an empty list: []
  • an empty record: {}
  • an empty binary value: 0x[]
  • null: null

Platform-specific char eol [toc]

In #15059, several additional escape characters were added to the char command:

  • eol
  • lsep
  • line_sep

These will output the newline character(s) for the current platform (i.e., \n on Unix and \r\n on Windows). This is different from newline, nl, line_feed, and lf which all output \n on all platforms.

into string --group-digits [toc]

With #15265, providing the --group-digits flag to the into string command will format integers by grouping several digits together and using the system locale digit separator.

from xml --allow-dtd [toc]

After #15272, document type declarations (DTD) can now parsed by from xml if you pass the new --allow-dtd flag.

to yml [toc]

As pointed out in #15240, it was previously possible to load data from YAML files using the from yaml or from yml commands, but only possible to save data using to yaml. Now, you can use either to yaml or to yml to save data into YAML files thanks to @LoicRiegel in #15254.

> [[foo bar]; ["1" "2"]] | to yml
- foo: '1'
  bar: '2'

Thanks to this, the save command can also be used with the .yml extension:

> [[foo bar]; ["1" "2"]] | save test.yml

overlay use completions [toc]

Thanks to @hongquan in #15057 with input from @blindFS, autocomplete now lists more directories for overlay use.

$env.config.filesize.show_unit [toc]

A new config option, $env.config.filesize.show_unit, was introduced in #15276. show_unit is true by default, but when it is set to false, file sizes will be displayed without units (e.g., in table). This can be useful if you have set filesize.unit to a fixed unit, and you do not want the same unit to be shown over and over again.

Backtraces for Nushell code [toc]

Some errors in Nushell code can be "chained", where one error condition creates another (and potentially another).

Previously, it could be difficult to find the source of the actual error, but with #14945, it is now possible to enable backtraces in Nushell code. To do so:

$env.NU_BACKTRACE = 1

... and re-run the failing code.

Startup banner theming [toc]

With #15095, it is now possible to set the styles used in the Welcome banner at startup using new $env.config.color_config settings:

  • banner_foreground: The primary color of the banner text
  • banner_highlight1: Used for the first set of highlights, e.g., Nushell, nu, GitHub, et. al
  • banner_highlight2: Used for the second set of highlights, e.g. Discord, Documentation, et. al.

Numeric range padding support in str expand [toc]

With #15125, @atahabaki added support for numeric ranges with padded zeros in str expand. For example:

'{00..10}' | str expand

Breaking changes [toc]

split list now keeps empty sublists [toc]

In #15161, if split list is used on a list with consecutive separators, it now returns an empty list. For example:

[1 1 0 0 3 3 0 4 4] | split list 0
# => [[1 1] [] [2 2] [3 3]]

match no longer executes closures as if they were a block [toc]

Prior to #15032, match would attempt to execute a closure returned from a match arm. Now, it returns the closure instead. For example:

Before #15032:

match 1 { _ => {|| print hi} }
# => hi

After #15032:

match 1 { _ => {|| print hi} }
# => closure_1090

PROMPT_* environment variables are no longer inherited [toc]

With #15130, the PROMPT_* environments are no longer inherited from the calling process. This prevents issues where some systems would set a POSIX-compatible PROMPT_COMMAND.

If a prompt setting is not defined in the startup config, a Nushell-compatible default is applied instead of allowing inheritance from the parent process.

Closure serialization changes [toc]

Prior to #15285, to json, to msgpack, and to msgpackz would serialize closures as a null. With this PR, these commands are aligned with the existing behavior of to nuon. Attempting to pass a closure (or data structure containing a closure) to one of these commands will result in an error. Instead, you can now use the to <format> --serialize option with all of these commands, in which case a string-representation of the closure will be serialized.

Filesize unit formatting [toc]

When setting a specific filesize unit via $env.config.filesize.unit, sizes will now be formatted using the default locale (e.g., separators and decimals). This returns a similar 0.98 behavior.

External completers are no longer used for internal commands [toc]

Prior to #15086, internal commands (including custom commands and aliases) without custom completions would fall back to the external completer. After this PR, internal commands will not use the external completer.

Note

The zoxide completer previously listed in the cookbook relied on this functionality. To update your zoxide completer to be compatible, you can (optionally) remove your external zoxide completer, add this to your config:

def "nu-complete zoxide path" [context: string] {
  let parts = $context | split row " " | skip 1
  {
    options: {
      sort: false
      completion_algorithm: prefix
      positional: false
      case_sensitive: false
    }
    completions: (zoxide query --list --exclude $env.PWD -- ...$parts | lines)
  }
}

def --env --wrapped z [...rest: string@"nu-complete zoxide path"] {
  __zoxide_z ...$rest
}

Note, if your zoxide configuration from zoxide init is in a vendor autoload, you should also add the above snippet to either a vendor autoload or user autoload, so that the __zoxide_z command is defined.

Removals [toc]

range [toc]

The range command has been removed in #15038 following it's deprecation in 0.102.0. Please use the slice command as one-to-one replacement.

into bits [toc]

The into bits command has been removed in #15039 following it's deprecation in 0.102.0. Please use the format bits command as one-to-one replacement.

fmt [toc]

The fmt command has been removed in #15040 following it's deprecation in 0.102.0. Please use the format number command as one-to-one replacement.

Bug fixes and other changes [toc]

authortitlelink
@Bahexmake echo const#14997
@Bahexfeat(std/dirs): retain state in subshells or with exec-restarts#15080
@Bahexfeat(overlay): expose constants with overlay use#15081
@Bahexfeat(const): implement run_const for const#15082
@IanManskeRework operator type errors#14429
@KAAtheWiseGitFix an integer overflow bug in into duration#15031
@LoicRiegelbugfix: math commands now return error with infinite range [#15135]#15236
@MMukundiFix insert/upsert creation for nested lists (#15131)#15133
@NotTheDr01dsFix improper application of local timezone offset to Unix epochs#15283
@WindSoilderallow export alias in repl#15054
@WindSoilderFix missing required overlay error#15058
@WindSoilderfix $env.FILE_PWD and $env.CURRENT_FILE inside overlay use#15126
@cosineblastTranspose now rejects streams with non-record values#15151
@dam4rusfeat(explore): Allow expanding selected cell with 'e'#15000
@hardfau1tfix(compact): compact empty list or record in column#15213
@sgvictorinocheck signals while printing values#14980
@sgvictorinofix ranges over zero-length input#15062
@sgvictorinocheck signals in nu-glob and ls#15140
@sgvictorinoprevent panic when parsing incomplete multi-expr matches#15230
@sholderbachBump bytesize to fix into filesize#15088
@sholderbachClose find handle in ls windows unsafe code#15314
@ysthakurFix spread operator lexing in records#15023
@ysthakurFix unterminated loop in parse_record#15246
@ysthakurInclude symlinks in directory completions#15268

Notes for plugin developers [toc]

None this release.

Hall of fame [toc]

Thanks to all the contributors below for helping us solve issues, improve documentation, refactor code, and more! 🙏

authortitlelink
@LoicRiegeldoc: clarify trailing line ending in 'to json -r' documentation#15234
@LoicRiegelrefactor: rename subcommand structs#15309
@MMeschadd polars str strip chars (with --end / --start options)#15118
@MMeschadds And and Or operators to polars plugin nu_expressions#15248
@MMeschAdd Xor to polars plugin nu_expressions#15249
@MMeschEnhance polars plugin documentation#15250
@MMeschAdds polars list-contains command#15304
@atahabakiFeature+: Bracoxide Zero Padding for Numeric Ranges#15125
@eggcakerfix polars save example typo#15008
@hardfau1tfix(test-support): use CARGO_BUILD_TARGET_DIR env var#15212
@hongquanImprove documentation for each command#15172
@sgvictorinoremove nu-check examples with the --all flag#15047
@tmillrfeat(cli): add vi solidus / keybinding#14908

Full changelog [toc]

authortitlelink
@132iklAdd search terms for hide and hide-env#15017
@132iklFix match running closures as block#15032
@132iklRun-time pipeline input type checking performance optimizations#15192
@132iklParse XML documents with DTDs by default, and add --disallow-dtd flag#15272
@132iklUnify closure serializing logic for to nuon, to msgpack, and to json#15285
@132iklDisallow DTD by default in from xml#15325
@BahexCustom command attributes#14906
@Bahexfix extern commands' extra description#14996
@Bahexmake echo const#14997
@Bahexfix block spans for the module keyword#15078
@Bahexuse 0-indexing in explore#15079
@Bahexfeat(std/dirs): retain state in subshells or with exec-restarts#15080
@Bahexfeat(overlay): expose constants with overlay use#15081
@Bahexfeat(const): implement run_const for const#15082
@Bahexdocs(std-rfc): use actual examples rather than doc comments#15097
@Bahexfix(test stdlib): scanning tests shouldn't be affected by user config#15113
@Bahexdocs(chunks): make chunks easier to discover for binary data#15117
@Bahexsplit list: add streaming, closure argument, and splitting before/after a separator#15161
@IanManskeRework operator type errors#14429
@IanManskeAdd insert benchmarks#15166
@IanManskeRespect system locale when formatting file sizes via config#15271
@IanManskeAdd filesize.show_unit config option#15276
@IanManskeinto string should not modify strings#15320
@KAAtheWiseGitFix an integer overflow bug in into duration#15031
@LoicRiegeldoc: clarify trailing line ending in 'to json -r' documentation#15234
@LoicRiegelbugfix: math commands now return error with infinite range [#15135]#15236
@LoicRiegelbugfix: add "to yml" command#15254
@LoicRiegelrefactor: rename subcommand structs#15309
@MMeschadd polars str strip chars (with --end / --start options)#15118
@MMeschadds And and Or operators to polars plugin nu_expressions#15248
@MMeschAdd Xor to polars plugin nu_expressions#15249
@MMeschEnhance polars plugin documentation#15250
@MMeschAdds polars list-contains command#15304
@MMukundiFix insert/upsert creation for nested lists (#15131)#15133
@NotTheDr01dsRemove --no-default-features for std-lib-and-python-virtualenv CI#15045
@NotTheDr01dsAdds platform agnostic EoL separator to char command#15059
@NotTheDr01dsFix char lsep assignment#15065
@NotTheDr01dsAdd std-rfc README#15066
@NotTheDr01dsMove std-rfc into Nushell#15042
@NotTheDr01dsEnable theming the Welcome Banner#15095
@NotTheDr01dsUpdate std-rfc tests to use @test attributes#15098
@NotTheDr01dsAdd buffer_editor example with arguments in config nu --doc#15122
@NotTheDr01dsFix failing test when using man version 2.13.0#15123
@NotTheDr01dsReplace "function" with "command" in several user-facing doc#15129
@NotTheDr01dsRemove inheritance for PROMPT variables created in default_env.nu#15130
@NotTheDr01dsRemove BACKTRACE message for non-panic errors#15143
@NotTheDr01dsAdd default --empty to handle empty values#15223
@NotTheDr01dsFix improper application of local timezone offset to Unix epochs#15283
@WindSoilderEnable nushell error with backtrace#14945
@WindSoilderupdate miette to 7.5#15014
@WindSoilderremove duplicate code in math/log.rs#15022
@WindSoilderallow export alias in repl#15054
@WindSoilderFix missing required overlay error#15058
@WindSoildermake plugin compatible with nightly nushell version#15084
@WindSoilderfix $env.FILE_PWD and $env.CURRENT_FILE inside overlay use#15126
@WindSoilderadd a helpful msg to indicate a job has been frozen#15206
@app/dependabotbuild(deps): bump crate-ci/typos from 1.29.4 to 1.29.5#15006
@app/dependabotbuild(deps): bump bytes from 1.9.0 to 1.10.0#15010
@app/dependabotbuild(deps): bump data-encoding from 2.7.0 to 2.8.0#15101
@app/dependabotbuild(deps): bump actions-rust-lang/setup-rust-toolchain from 1.10.1 to 1.11.0#15179
@app/dependabotbuild(deps): bump crate-ci/typos from 1.29.5 to 1.29.10#15180
@app/dependabotbuild(deps): bump rust-embed from 8.5.0 to 8.6.0#15183
@app/dependabotbuild(deps): bump scraper from 0.22.0 to 0.23.1#15294
@app/dependabotbuild(deps): bump titlecase from 3.3.0 to 3.4.0#15295
@app/dependabotbuild(deps): bump zip from 2.2.1 to 2.4.1#15335
@atahabakiFeature+: Bracoxide Zero Padding for Numeric Ranges#15125
@ayamdobhalfeat(random uuid): add support for uuid versions other than 4.#15239
@ayax79Added S3 support for polars save#15005
@ayax79Polars: Minor code cleanup#15144
@ayax79Expose flag to not maintain order on polars concat#15145
@ayax79move to polars bigidx#15177
@ayax79polars strip-chars: Allow any polars expression for pattern argument#15178
@ayax79polars open: exposing the ability to configure hive settings.#15255
@ayax79Polars: Map pq extension to parquet files#15284
@ayax79Support for reading Categorical and Enum types#15292
@blindFSrefactor(completion): AST traverse to find the inner-most expression to complete#14973
@blindFSrefactor(completion): expression based variable/cell_path completion#15033
@blindFSfix: clippy warnings with --all-features#15035
@blindFSfix(lsp): exit on null root_dir#15051
@blindFSfix(lsp): inlay hints span issue with user config scripts#15071
@blindFSrefactor(completion): flatten_shape -> expression for internal/external/operator#15086
@blindFSfeat(lsp): hover on external command shows manpage#15115
@blindFSfix(completion): edge cases of operator completions#15169
@blindFSfix(completion): prefix_str should be trimmed to element_expression#15171
@blindFSfeat(lsp): semantic tokens for highlighting internal commands with spaces#15173
@blindFSfix(lsp): completion of commands defined after the cursor#15188
@blindFSfix: new clippy warnings from rust 1.85.0#15203
@blindFSfix(lsp): completion label descriptions for cell_path and external values#15226
@blindFSfeat(lsp): signature help (manually triggered)#15233
@blindFSfix(lsp): completion on command with following text#15238
@blindFSfeat(lsp): completion items now respect the append_whitespace flag#15247
@blindFSfix: security_audit, bump ring from 0.17.8 to 0.17.13#15263
@blindFSrefactor(lsp): span fix made easy by bumping lsp-textdocument to 0.4.2#15287
@blindFSfix(lsp): find_id for custom def in custom def#15289
@blindFSfix(completion): more quoting for file_completion/directory_completion#15299
@blindFSrefactor: tree-sitter-nu friendly alternative expressions#15301
@blindFSfix(completion): full set of operators for type any#15303
@blindFSfix(lsp): ansi strip on hover text#15331
@cosineblastJobs#14883
@cosineblastTranspose now rejects streams with non-record values#15151
@cptpiepmatzReplaced IoError::new_with_additional_context calls that still had Span::unknown()#15056
@cptpiepmatzUse proc-macro-error2 instead of proc-macro-error#15093
@cptpiepmatzMore precise ErrorKind::NotFound errors#15149
@cptpiepmatzTest on Beta Toolchain#15280
@dam4rusfeat(explore): Allow expanding selected cell with 'e'#15000
@eggcakerfix polars save example typo#15008
@fdncredadd attr category @category to custom command attributes#15137
@fdncredupdate to the latest reedline#15139
@fdncredbump the rust toolchain to 1.83.0#15148
@fdncredallow bench to handle larger numbers#15162
@fdncredupdate query json help and examples#15190
@fdncredupdate reedline editcommands in nushell#15191
@fdncredallow --group-digits to be used in into string#15265
@fdncredremove mimalloc allocator#15317
@hardfau1tfix(test-support): use CARGO_BUILD_TARGET_DIR env var#15212
@hardfau1tfix(compact): compact empty list or record in column#15213
@hongquanProvide more directories autocomplete for "overlay use"#15057
@hongquanImprove documentation for each command#15172
@hustcerFix tests of docker image and Update Nu LICENSE#15015
@hustcerRefactor kv commands: replace inline params in SQL queries#15108
@hustcerAdd ansi codes to move cursor position#15221
@hustcerUpdate toolkit.nu add nu_plugin_polars plugin for build and install#15324
@hustcerAdd category to pwd and banner commands#15330
@kubouchRemove Twitter from README#15026
@sgvictorinocheck signals while printing values#14980
@sgvictorinoremove nu-check examples with the --all flag#15047
@sgvictorinofix ranges over zero-length input#15062
@sgvictorinocheck signals in nu-glob and ls#15140
@sgvictorinoprevent panic when parsing incomplete multi-expr matches#15230
@sholderbachFuzz more realistically with keyword const eval#15036
@sholderbachTrigger tests for patch release branch pushes#15037
@sholderbachRemove range command after deprecation#15038
@sholderbachRemove into bits after deprecation#15039
@sholderbachRemove fmt after deprecation#15040
@sholderbachFix usages of fmt to format number#15041
@sholderbachUse build_target information in startup banner#15046
@sholderbachRefactor/fix tests affecting the whole command set#15073
@sholderbachBump bytesize to fix into filesize#15088
@sholderbachFix match blocks in std-rfc/kv implementation#15089
@sholderbachBump yanked dependencies#15090
@sholderbachBump Ubuntu runners to 22.04 LTS for tests#15109
@sholderbachRevert / vi binding due to priority bug#15111
@sholderbachBump ratatui to 0.29.0#15187
@sholderbachBump reedline to latest commit#15189
@sholderbachBump reedline for recent completion fix#15310
@sholderbachClose find handle in ls windows unsafe code#15314
@sholderbachPin reedline to 0.39.0 for release#15338
@tmillrfeat(cli): add vi solidus / keybinding#14908
@ysthakurBump to 0.102.1 dev version#15012
@ysthakurFix spread operator lexing in records#15023
@ysthakurFix unterminated loop in parse_record#15246
@ysthakurInclude symlinks in directory completions#15268
@ysthakurFeature-gate job unfreeze behind "os"#15339
Edit this page on GitHub
Contributors: ysthakur, NotTheDr01ds, Ian Manske, LoicRiegel, Jan Klass, 132ikl