Skip to content

Latest commit

 

History

History
154 lines (110 loc) · 15.9 KB

2022-09-27-nushell-0_69.md

File metadata and controls

154 lines (110 loc) · 15.9 KB
title author author_site author_image excerpt
Nushell 0.69
The Nu Authors
Today, we're releasing version 0.69 of Nu. This release includes bugfixes and improvements to existing languages.

Nushell 0.69

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 version 0.69 of Nu. This release includes bugfixes and improvements to existing languages.

Where to get it

Nu 0.69 is available as pre-built binaries or from crates.io. Note: this release is officially "0.69.1" because of a last-minute issue that was found and fixed. If you have Rust installed you can install it using cargo install nu.

If you want all the built-in goodies, you can install cargo install nu --features=extra.

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

Finishing the rework of modules and environment (WindSoilder, kubouch)

If you followed the development since the last release, you might have noticed we successfully applied "the method of dead ends" pioneered by Jára Cimrman: "Somebody had to probe this dead end of human knowledge and announce to the world: Not this way, friends!" In short, the source-env experiment did not work out as planned. We hoped to allow to call source-env with dynamic paths which, however, proved unfeasible. Therefore, in this release, we remove all notions of source-env from Nushell and instead use will be used activate the module's environment. Any call to use will run the module's export-env { ... } block (if there is one) and keep its environment. A positive side of it is that one call of use is enough to import both commands/aliases and the environment, there is no need to call two separate commands as we planned for source-env.

We're also keeping the source command for now, as well as the current config file format. One reason is that we want to first investigate whether it is possible to export also regular variables from modules and whether we can use the module keyword inside modules. However, the use of modules is still preferred over source as it will become the default way in the future.

Summary of deprecations

Here is a recap of the table posted in the previous release post with updated entries.

command pre-previous release (0.67) previous release (0.68) this release (0.69)
source imports everything into the current scope same (deprecated) same (deprecated)
source-env N/A imports environment variables removed
use imports environment variables, commands and aliases same same
hide hides environment variables, commands and aliases same hides only commands and aliases*
hide-env hides environment variables same same
export env defines a single environment variable in a module same removed
export-env N/A (in a module) defines the environment for the whole module same
export-env N/A (in a script) when evaluated, preserves the environment from the block same
export ... only allowed in a module allowed in a script as well same
config.nu plain script plain script plain script
env.nu plain script plain script plain script
login.nu plain script plain script plain script
  • Technically, hide still hides environment variables but it works in a "compatibility mode" that is intended to only serve its purpose in the virtualenv activation script. As soon as the virtualenv integration gets updated, hiding environment variables with hide will be removed completely.

Upcoming virtualenv activation changes (kubouch)

To reflect the recent changes to the module environment, we are changing the virtualenv integration to use overlays. This will come in effect as soon as this PR gets merged. In practice, this means that instead of source activate.nu, you'll use overlay use activate.nu, deactivate will work the same.

Under the hood, calling overlay use activate.nu will activate the activate overlay and deactivate is just an alias for calling overlay hide activate. If you wish, you can manually name the overlay, for example overlay use activate.nu as spam, but then you'd need to remove it with overlay hide spam instead of deactivate.

Grammar Experiments (Sophia)

We've recently also started working on some improvements to Nushell's syntax. While these aren't part of Nushell 0.69, you can try this experimental syntax in our new grammar repo. Some experiments we're looking into:

Traditional function definition syntax

def foo(x: int) { ... }

Traditional function call syntax

foo(3)

And much more. We're hoping to talk more about these experiments as they mature.

Breaking changes

We found a regression in the correctness of the -d and -t flags of touch. To get the release out, we've removed these flags, but hope to replace them with correct implementations in the future.

We also removed support for duration literals above weeks, including month, year, and decade literals. These were found to be confusing as it's unclear what a duration of a month is (30 days? 31 days?)

The str collect command is now str join.

Next Steps

We've been progressing with our design towards 0.80 as outlined in this Notion page.

Some time was spent trying out possible new syntax directions but we were not confident to release them yet. In the next release we'll see a removal of features deprecated in this release and we'll continue to push ahead for the 0.80.

Full changelog

Nushell

Extension

Documentation

Nu_Scripts

reedline