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
- 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 withhelp --find
(orhelp -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, includinginto list
,columns-into-table
,name-values
,record-into-columns
, andtable-into-columns
.std-rfc/tables
: New commands toselect
andreject
columns and rows based on slices, and a newaggregate
command for running calculations on aggregated table data.aggregate
is even more useful when paired withgroup-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
andclip paste
commands for interacting with the system clipboard (requires terminal support).std-rfc/str
:dedent
andunindent
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
From @thomasschafer
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 usinghelp --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 textbanner_highlight1
: Used for the first set of highlights, e.g.,Nushell
,nu
,GitHub
, et. albanner_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.
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]
author | title | link |
---|---|---|
@Bahex | make echo const | #14997 |
@Bahex | feat(std/dirs): retain state in subshells or with exec-restarts | #15080 |
@Bahex | feat(overlay): expose constants with overlay use | #15081 |
@Bahex | feat(const): implement run_const for const | #15082 |
@IanManske | Rework operator type errors | #14429 |
@KAAtheWiseGit | Fix an integer overflow bug in into duration | #15031 |
@LoicRiegel | bugfix: math commands now return error with infinite range [#15135] | #15236 |
@MMukundi | Fix insert/upsert creation for nested lists (#15131) | #15133 |
@NotTheDr01ds | Fix improper application of local timezone offset to Unix epochs | #15283 |
@WindSoilder | allow export alias in repl | #15054 |
@WindSoilder | Fix missing required overlay error | #15058 |
@WindSoilder | fix $env.FILE_PWD and $env.CURRENT_FILE inside overlay use | #15126 |
@cosineblast | Transpose now rejects streams with non-record values | #15151 |
@dam4rus | feat(explore): Allow expanding selected cell with 'e' | #15000 |
@hardfau1t | fix(compact): compact empty list or record in column | #15213 |
@sgvictorino | check signals while printing values | #14980 |
@sgvictorino | fix ranges over zero-length input | #15062 |
@sgvictorino | check signals in nu-glob and ls | #15140 |
@sgvictorino | prevent panic when parsing incomplete multi-expr matches | #15230 |
@sholderbach | Bump bytesize to fix into filesize | #15088 |
@sholderbach | Close find handle in ls windows unsafe code | #15314 |
@ysthakur | Fix spread operator lexing in records | #15023 |
@ysthakur | Fix unterminated loop in parse_record | #15246 |
@ysthakur | Include 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! 🙏
author | title | link |
---|---|---|
@LoicRiegel | doc: clarify trailing line ending in 'to json -r' documentation | #15234 |
@LoicRiegel | refactor: rename subcommand structs | #15309 |
@MMesch | add polars str strip chars (with --end / --start options) | #15118 |
@MMesch | adds And and Or operators to polars plugin nu_expressions | #15248 |
@MMesch | Add Xor to polars plugin nu_expressions | #15249 |
@MMesch | Enhance polars plugin documentation | #15250 |
@MMesch | Adds polars list-contains command | #15304 |
@atahabaki | Feature+: Bracoxide Zero Padding for Numeric Ranges | #15125 |
@eggcaker | fix polars save example typo | #15008 |
@hardfau1t | fix(test-support): use CARGO_BUILD_TARGET_DIR env var | #15212 |
@hongquan | Improve documentation for each command | #15172 |
@sgvictorino | remove nu-check examples with the --all flag | #15047 |
@tmillr | feat(cli): add vi solidus / keybinding | #14908 |
Full changelog [toc]
author | title | link |
---|---|---|
@132ikl | Add search terms for hide and hide-env | #15017 |
@132ikl | Fix match running closures as block | #15032 |
@132ikl | Run-time pipeline input type checking performance optimizations | #15192 |
@132ikl | Parse XML documents with DTDs by default, and add --disallow-dtd flag | #15272 |
@132ikl | Unify closure serializing logic for to nuon , to msgpack , and to json | #15285 |
@132ikl | Disallow DTD by default in from xml | #15325 |
@Bahex | Custom command attributes | #14906 |
@Bahex | fix extern commands' extra description | #14996 |
@Bahex | make echo const | #14997 |
@Bahex | fix block spans for the module keyword | #15078 |
@Bahex | use 0-indexing in explore | #15079 |
@Bahex | feat(std/dirs): retain state in subshells or with exec-restarts | #15080 |
@Bahex | feat(overlay): expose constants with overlay use | #15081 |
@Bahex | feat(const): implement run_const for const | #15082 |
@Bahex | docs(std-rfc): use actual examples rather than doc comments | #15097 |
@Bahex | fix(test stdlib): scanning tests shouldn't be affected by user config | #15113 |
@Bahex | docs(chunks): make chunks easier to discover for binary data | #15117 |
@Bahex | split list : add streaming, closure argument, and splitting before/after a separator | #15161 |
@IanManske | Rework operator type errors | #14429 |
@IanManske | Add insert benchmarks | #15166 |
@IanManske | Respect system locale when formatting file sizes via config | #15271 |
@IanManske | Add filesize.show_unit config option | #15276 |
@IanManske | into string should not modify strings | #15320 |
@KAAtheWiseGit | Fix an integer overflow bug in into duration | #15031 |
@LoicRiegel | doc: clarify trailing line ending in 'to json -r' documentation | #15234 |
@LoicRiegel | bugfix: math commands now return error with infinite range [#15135] | #15236 |
@LoicRiegel | bugfix: add "to yml" command | #15254 |
@LoicRiegel | refactor: rename subcommand structs | #15309 |
@MMesch | add polars str strip chars (with --end / --start options) | #15118 |
@MMesch | adds And and Or operators to polars plugin nu_expressions | #15248 |
@MMesch | Add Xor to polars plugin nu_expressions | #15249 |
@MMesch | Enhance polars plugin documentation | #15250 |
@MMesch | Adds polars list-contains command | #15304 |
@MMukundi | Fix insert/upsert creation for nested lists (#15131) | #15133 |
@NotTheDr01ds | Remove --no-default-features for std-lib-and-python-virtualenv CI | #15045 |
@NotTheDr01ds | Adds platform agnostic EoL separator to char command | #15059 |
@NotTheDr01ds | Fix char lsep assignment | #15065 |
@NotTheDr01ds | Add std-rfc README | #15066 |
@NotTheDr01ds | Move std-rfc into Nushell | #15042 |
@NotTheDr01ds | Enable theming the Welcome Banner | #15095 |
@NotTheDr01ds | Update std-rfc tests to use @test attributes | #15098 |
@NotTheDr01ds | Add buffer_editor example with arguments in config nu --doc | #15122 |
@NotTheDr01ds | Fix failing test when using man version 2.13.0 | #15123 |
@NotTheDr01ds | Replace "function" with "command" in several user-facing doc | #15129 |
@NotTheDr01ds | Remove inheritance for PROMPT variables created in default_env.nu | #15130 |
@NotTheDr01ds | Remove BACKTRACE message for non-panic errors | #15143 |
@NotTheDr01ds | Add default --empty to handle empty values | #15223 |
@NotTheDr01ds | Fix improper application of local timezone offset to Unix epochs | #15283 |
@WindSoilder | Enable nushell error with backtrace | #14945 |
@WindSoilder | update miette to 7.5 | #15014 |
@WindSoilder | remove duplicate code in math/log.rs | #15022 |
@WindSoilder | allow export alias in repl | #15054 |
@WindSoilder | Fix missing required overlay error | #15058 |
@WindSoilder | make plugin compatible with nightly nushell version | #15084 |
@WindSoilder | fix $env.FILE_PWD and $env.CURRENT_FILE inside overlay use | #15126 |
@WindSoilder | add a helpful msg to indicate a job has been frozen | #15206 |
@app/dependabot | build(deps): bump crate-ci/typos from 1.29.4 to 1.29.5 | #15006 |
@app/dependabot | build(deps): bump bytes from 1.9.0 to 1.10.0 | #15010 |
@app/dependabot | build(deps): bump data-encoding from 2.7.0 to 2.8.0 | #15101 |
@app/dependabot | build(deps): bump actions-rust-lang/setup-rust-toolchain from 1.10.1 to 1.11.0 | #15179 |
@app/dependabot | build(deps): bump crate-ci/typos from 1.29.5 to 1.29.10 | #15180 |
@app/dependabot | build(deps): bump rust-embed from 8.5.0 to 8.6.0 | #15183 |
@app/dependabot | build(deps): bump scraper from 0.22.0 to 0.23.1 | #15294 |
@app/dependabot | build(deps): bump titlecase from 3.3.0 to 3.4.0 | #15295 |
@app/dependabot | build(deps): bump zip from 2.2.1 to 2.4.1 | #15335 |
@atahabaki | Feature+: Bracoxide Zero Padding for Numeric Ranges | #15125 |
@ayamdobhal | feat(random uuid): add support for uuid versions other than 4. | #15239 |
@ayax79 | Added S3 support for polars save | #15005 |
@ayax79 | Polars: Minor code cleanup | #15144 |
@ayax79 | Expose flag to not maintain order on polars concat | #15145 |
@ayax79 | move to polars bigidx | #15177 |
@ayax79 | polars strip-chars : Allow any polars expression for pattern argument | #15178 |
@ayax79 | polars open : exposing the ability to configure hive settings. | #15255 |
@ayax79 | Polars: Map pq extension to parquet files | #15284 |
@ayax79 | Support for reading Categorical and Enum types | #15292 |
@blindFS | refactor(completion): AST traverse to find the inner-most expression to complete | #14973 |
@blindFS | refactor(completion): expression based variable/cell_path completion | #15033 |
@blindFS | fix: clippy warnings with --all-features | #15035 |
@blindFS | fix(lsp): exit on null root_dir | #15051 |
@blindFS | fix(lsp): inlay hints span issue with user config scripts | #15071 |
@blindFS | refactor(completion): flatten_shape -> expression for internal/external/operator | #15086 |
@blindFS | feat(lsp): hover on external command shows manpage | #15115 |
@blindFS | fix(completion): edge cases of operator completions | #15169 |
@blindFS | fix(completion): prefix_str should be trimmed to element_expression | #15171 |
@blindFS | feat(lsp): semantic tokens for highlighting internal commands with spaces | #15173 |
@blindFS | fix(lsp): completion of commands defined after the cursor | #15188 |
@blindFS | fix: new clippy warnings from rust 1.85.0 | #15203 |
@blindFS | fix(lsp): completion label descriptions for cell_path and external values | #15226 |
@blindFS | feat(lsp): signature help (manually triggered) | #15233 |
@blindFS | fix(lsp): completion on command with following text | #15238 |
@blindFS | feat(lsp): completion items now respect the append_whitespace flag | #15247 |
@blindFS | fix: security_audit, bump ring from 0.17.8 to 0.17.13 | #15263 |
@blindFS | refactor(lsp): span fix made easy by bumping lsp-textdocument to 0.4.2 | #15287 |
@blindFS | fix(lsp): find_id for custom def in custom def | #15289 |
@blindFS | fix(completion): more quoting for file_completion/directory_completion | #15299 |
@blindFS | refactor: tree-sitter-nu friendly alternative expressions | #15301 |
@blindFS | fix(completion): full set of operators for type any | #15303 |
@blindFS | fix(lsp): ansi strip on hover text | #15331 |
@cosineblast | Jobs | #14883 |
@cosineblast | Transpose now rejects streams with non-record values | #15151 |
@cptpiepmatz | Replaced IoError::new_with_additional_context calls that still had Span::unknown() | #15056 |
@cptpiepmatz | Use proc-macro-error2 instead of proc-macro-error | #15093 |
@cptpiepmatz | More precise ErrorKind::NotFound errors | #15149 |
@cptpiepmatz | Test on Beta Toolchain | #15280 |
@dam4rus | feat(explore): Allow expanding selected cell with 'e' | #15000 |
@eggcaker | fix polars save example typo | #15008 |
@fdncred | add attr category @category to custom command attributes | #15137 |
@fdncred | update to the latest reedline | #15139 |
@fdncred | bump the rust toolchain to 1.83.0 | #15148 |
@fdncred | allow bench to handle larger numbers | #15162 |
@fdncred | update query json help and examples | #15190 |
@fdncred | update reedline editcommands in nushell | #15191 |
@fdncred | allow --group-digits to be used in into string | #15265 |
@fdncred | remove mimalloc allocator | #15317 |
@hardfau1t | fix(test-support): use CARGO_BUILD_TARGET_DIR env var | #15212 |
@hardfau1t | fix(compact): compact empty list or record in column | #15213 |
@hongquan | Provide more directories autocomplete for "overlay use" | #15057 |
@hongquan | Improve documentation for each command | #15172 |
@hustcer | Fix tests of docker image and Update Nu LICENSE | #15015 |
@hustcer | Refactor kv commands: replace inline params in SQL queries | #15108 |
@hustcer | Add ansi codes to move cursor position | #15221 |
@hustcer | Update toolkit.nu add nu_plugin_polars plugin for build and install | #15324 |
@hustcer | Add category to pwd and banner commands | #15330 |
@kubouch | Remove Twitter from README | #15026 |
@sgvictorino | check signals while printing values | #14980 |
@sgvictorino | remove nu-check examples with the --all flag | #15047 |
@sgvictorino | fix ranges over zero-length input | #15062 |
@sgvictorino | check signals in nu-glob and ls | #15140 |
@sgvictorino | prevent panic when parsing incomplete multi-expr matches | #15230 |
@sholderbach | Fuzz more realistically with keyword const eval | #15036 |
@sholderbach | Trigger tests for patch release branch pushes | #15037 |
@sholderbach | Remove range command after deprecation | #15038 |
@sholderbach | Remove into bits after deprecation | #15039 |
@sholderbach | Remove fmt after deprecation | #15040 |
@sholderbach | Fix usages of fmt to format number | #15041 |
@sholderbach | Use build_target information in startup banner | #15046 |
@sholderbach | Refactor/fix tests affecting the whole command set | #15073 |
@sholderbach | Bump bytesize to fix into filesize | #15088 |
@sholderbach | Fix match blocks in std-rfc/kv implementation | #15089 |
@sholderbach | Bump yanked dependencies | #15090 |
@sholderbach | Bump Ubuntu runners to 22.04 LTS for tests | #15109 |
@sholderbach | Revert / vi binding due to priority bug | #15111 |
@sholderbach | Bump ratatui to 0.29.0 | #15187 |
@sholderbach | Bump reedline to latest commit | #15189 |
@sholderbach | Bump reedline for recent completion fix | #15310 |
@sholderbach | Close find handle in ls windows unsafe code | #15314 |
@sholderbach | Pin reedline to 0.39.0 for release | #15338 |
@tmillr | feat(cli): add vi solidus / keybinding | #14908 |
@ysthakur | Bump to 0.102.1 dev version | #15012 |
@ysthakur | Fix spread operator lexing in records | #15023 |
@ysthakur | Fix unterminated loop in parse_record | #15246 |
@ysthakur | Include symlinks in directory completions | #15268 |
@ysthakur | Feature-gate job unfreeze behind "os" | #15339 |