Nushell 0.84.0

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.84.0 of Nu. This release adds exporting constants from modules, scope commands improvements, cosmetic changes, and many smaller changes to our commands.

Where to get it

Nu 0.84.0 is available as pre-built binariesopen in new window or from crates.ioopen in new window. If you have Rust installed you can install it using cargo install nu.

NOTE: The optional dataframe functionality is available by cargo install nu --features=dataframe.

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

Themes of this release / New features

(Major Breaking Change!) str replace matches substring by default (kubouchopen in new window)

Breaking change

See a full overview of the breaking changes

str replace now matches a substring instead of a regular expression by default and the -s/--string flag is deprecated (will be removed altogether in 0.85). Matching a substring by default makes it more consistent with the rest of the Nushell's commands.

💡 Note! Since str replace is a widely used command, many scripts are going to break. Fixing it is easy:

  • If you used str replace without the -s/--string flag, you used regex matching and you should add --regex flag to keep the previous functionality.
  • If you used str replace with the -s/--string flag, you will get a deprecation warning. To get rid of the warning, simply remove the flag.

Constants from modules (WindSoilderopen in new window, kubouchopen in new window)

You can now use constants in modules and export them. Calling use on a module will create record containing all module's constants. You can also import the constants directly, for example with use module.nu const-name, without creating the module's record. Example:

> module spam {
    export const X = 'x'
    export module eggs {
        export const Y = 'y'
        export const viking = 'eats'
    }
}

> use spam

> $spam
╭──────┬───────────────────╮
 eggs {record 2 fields} 
 X x
╰──────┴───────────────────╯

> $spam.eggs
╭────────┬──────╮
 Y y
 viking eats
╰────────┴──────╯

> use spam eggs viking

> $viking
eats

The exported values are true constants which means that you can use them in some scenarios where you cannot use normal variables, such as:

> module files {
    export const MY_CONFIG = '/home/viking/.config/nushell/my_config.nu'
}

> use files MY_CONFIG

> source $MY_CONFIG  # sources '/home/viking/.config/nushell/my_config.nu'

New options for more compact table display (@zhiburtopen in new window, #9796open in new window)

To save screen space, you can now display tables with the header directly displayed on the border through the $env.config.table.header_on_separator option.

Table with header displayed on border

Additionally you can now configure the padding left and right of the table cell content either separately or all at once to adjust the layout for your readability needs.

Table with different padding options

More consistent format ... commands (@sholderbachopen in new window, @WindSoilderopen in new window)

Breaking change

See a full overview of the breaking changes

With this release we moved several commands that serve to produce string output from a particular data type as format subcommands.

  1. date format has been renamed to format date (#9788open in new window).
  2. into duration --convert was previously used to provide string representations of durations. This option has been removed and you should now use format duration. (#9902open in new window)
  3. format filesize that was previously moved into the --features extra set is back in the core (#9978open in new window).

scope commands enhancements (kubouchopen in new window, kubouchopen in new window)

scope commands received a significant amount of improvements making them more useful for advanced introspection of Nushell's definitions.

  • scope externs now lists known externals (defined with extern)
  • scope aliases is now fixed and lists names and usages of the aliases, not of the aliased commands (this used to cause some confusion)
  • scope modules now lists all the exportable of the module, including submodules with their contents
  • all scope commands now list the definition's ID which can be used for reliable tracking of definitions. For example, a command foo imported from a module spam using use spam will be named spam foo, therefore, relying solely on names of the definitions can sometimes be misleading.
  • module_name field is no longer present
  • scope variables now denotes whether a variable is a constant or not

http commands now handle headers better (@jflics6460open in new window, @ineuopen in new window

You can now pass headers directly as a record to the -H flag.

http get -H {cookie: "acc=foobar"} http://example.com

When running a http command with --full to get additional metadata about the response you can now get both the request and the response header

http get --full -H {cooke: "my=cookie"} | get headers | get response

Work on the optional dataframe features (@ayax79open in new window)

@ayax79open in new window has been working hard to update our dataframe command to work again with the stricter type check by consolidating internal logic (#9860open in new window, #9951open in new window).

Furthermore, dfr open now supports the avro exchange format and a new dfr to-avro command was added in #10019open in new window

Changes to other commands

Since last release, some commands have changed, here is a list of some interesting changed

Command organization (@stormopen in new window, @sophiajtopen in new window)

In our efforts towards stabilization we moved several commands either behind the --features extra build-flag or back into the core set of commands. The special str *-case commands for example have been moved out of the core set, while the bytes commands to deal with bytes in arbitrary encodings have returned to the core set. Furthermore all commands in the core set should now have helpful categories associated with them.

Deprecation and removal of commands (@amtoineopen in new window, @sholderbachopen in new window)

We previously used the term "deprecation" pretty loosely to describe the removal of commands while emitting a helpful error. We intend to now start to use deprecation to warn you before the final removal of a particular option or command. When we removed a command we will now properly refer to it as removal and started adding warnings where appropriate (e.g. str replace --string). As part of this update we removed some very old error helpers nudging you to upgrade to new commands.

Documentation

Thanks to @rgwoodopen in new window, @sholderbachopen in new window, @kubouchopen in new window and @fdncredopen in new window the documentation has become a bit better in #9961open in new window, #9996open in new window, #10004open in new window and #10057open in new window.

Notable bugfixes

Bugfixes

Thanks to all the contributors who tackled one or more bugs!

NameLinkDescription
@mengsuenyanopen in new window#9853open in new windowFix ~ | path type returning empty string
@mengsuenyanopen in new window#9851open in new windowFix the panic when type a statement similar to let f = 'f' $ in the nushell
@sophiajtopen in new window#9893open in new windowRevert #9693open in new window to prevent CPU hangs
@NotLebedevopen in new window#9935open in new windowNothing has the correct return type
@amtoineopen in new window#9947open in new windowForce version to update when installing with toolkit.nu
@amtoineopen in new window#9967open in new windowFix panic with lines on an error
@rgwoodopen in new window#9990open in new windowFix watch not handling all file changes
@nibon7open in new window#9784open in new windowFix a crash when moving the cursor after accepting a suggestion from the help menu
@meskillopen in new window#10007open in new windowFix parser to not update plugin.nu file on nu startup
@zhiburtopen in new window#10011open in new windownu-table: Fix padding 0 width issues
@3lvir4open in new window#10012open in new windowRemove potential panic from path join
@kubouchopen in new window#10046open in new windowFix wrong path expansion in save
@zhiburtopen in new window#10050open in new windownu-table: Fix issue with truncation and text border
@sophiajtopen in new window#10052open in new windowFix default_env.nu after latest changes to str replace
@fdncredopen in new window#10067open in new windowAllow return to return any nushell value
@fdncredopen in new window#10063open in new windowFix into datetime to accept more date/time formats

And also to those who did tackle purely technical challenges!!

NameLinkDescription
@IanManskeopen in new window#9909open in new windowEnable macOS foreground process handling
@sophiajtopen in new window#9933open in new windowAdd tests for script subcommands
@sophiajtopen in new window#9936open in new windowFix a couple clippy warnings
@IanManskeopen in new window#9927open in new windowMake Value::columns return slice instead of cloned Vec
@sophiajtopen in new window#9949open in new windowMove help commands to use more structure in signatures
@fdncredopen in new window#9958open in new windowUpdate strip-ansi-escapes to use new api
@rgwoodopen in new window#9971open in new windowPut heavy dataframe dependencies behind feature flag
@sholderbachopen in new window#9974open in new windowFixup dataframe build after #9971open in new window
@meskillopen in new window#9976open in new windowtest: Clear parent environment to prevent leakage to tests
@kubouchopen in new window#10036open in new windowAdd additional span to IncorrectValue error

Breaking changes

  • #9902open in new window date format has been renamed to format date for consistency.
  • #9788open in new window The option into duration --convert to format durations has been removed. Use the format duration command instead.
  • #10038open in new window str replace now by default matches to strings by default. If you want to use regexes you need to use the -r flag. The --strings flag has been removed
  • #9632open in new window To be unambiguous the duration type now does not report months or years. The largest unit reported is weeks as they have a consistent length compared to months or years.
  • #9926open in new window We moved some of the more exotic str case-commands behind the --features extra build-flag. This affects:
    • str camel-case
    • str kebab-case
    • str pascal-case
    • str screaming-snake-case
    • str snake-case
    • str title-case
  • #10053open in new window make the charpage optional for std clip
  • #10023open in new window The output of the scope commands has changed

Internal breaking change only affecting plugin authors

Full changelog

Nushell

Extension

Documentation

Nu_Scripts

Reedline