Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
156 changes: 127 additions & 29 deletions blog/2024-11-12-nushell_0_100_0.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ author_site: https://twitter.com/nu_shell
author_image: https://www.nushell.sh/blog/images/nu_logo.png
excerpt: Today, we're releasing version 0.100.0 of Nu. This release adds...
---

<!-- TODO: complete the excerpt above -->

# Nushell 0.100.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.

<!-- TODO: write this excerpt -->

Today, we're releasing version 0.100.0 of Nu. This release adds...

# Where to get it
Expand All @@ -21,6 +23,7 @@ Nu 0.100.0 is available as [pre-built binaries](https://github.com/nushell/nushe
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_](#highlights-and-themes-of-this-release-toc)
- [_Changes_](#changes-toc)
- [_Additions_](#additions-toc)
Expand Down Expand Up @@ -48,6 +51,7 @@ As part of this release, we also publish a set of optional plugins you can insta
-->

# Highlights and themes of this release [[toc](#table-of-content)]

<!-- NOTE: if you wanna write a section about a breaking change, when it's a very important one,
please add the following snippet to have a "warning" banner :)
> see [an example](https://www.nushell.sh/blog/2023-09-19-nushell_0_85_0.html#pythonesque-operators-removal)
Expand All @@ -66,56 +70,150 @@ As part of this release, we also publish a set of optional plugins you can insta

## Additions [[toc](#table-of-content)]

### `like` and `not-like` operators

With [#14072](https://github.com/nushell/nushell/pull/14072), this release adds two "new" operators: `like` and `not-like`. These operators are alternative forms of the preexisting `=~` and `!~` operators, respectively. The only reason to use one form over the other is preference. For example, people familiar with SQL may prefer using `like` and `not-like`. In the future, there is a chance that the shorter forms may be removed, but there are no plans to do so yet, if at all.

### `catch` error record

In [#14082](https://github.com/nushell/nushell/pull/14082), two additional columns were added to the error record passed to catch blocks/closures:

- `json`: a string containing the error data as JSON.
- `rendered`: a string containing the pretty formatted error message, roughly the same as you would see in your terminal.

### `help commands` and `scope commands`

The `help commands` and `scope commands` now output an `is_const` column indicating whether a command can be used in a parse-time constant context ([#14125](https://github.com/nushell/nushell/pull/14125)).

### `ps -l`

On macOS, `ps -l` now lists the `start_time` of the processes. Windows and Linux already listed a `start_time` column ([#14127](https://github.com/nushell/nushell/pull/14127)).

### `url build-query`

Thanks to [@adaschma](https://github.com/adaschma) in [#14073](https://github.com/nushell/nushell/pull/14073), `url build-query` now allows list values in the parameter record. For example:

```nu
{ a: [1 2], b: 3 } | url build-query
# a=1&a=2&b=3
```

### `stor`

`stor` now supports list and table inputs thanks to [@friaes](https://github.com/friaes) in [#14175](https://github.com/nushell/nushell/pull/14175).

### `to text --no-newline`

In [#14158](https://github.com/nushell/nushell/pull/14158), the `--no-newline`/`-n` flag was added to `to text`. Providing this flag disables the trailing new line added to the output.

```nu
[a] | to text # "a\n"
[a] | to text -n # "a"

[a b] | to text # "a\nb\n"
[a b] | to text -n # "a\nb"
```

### `open --raw`

After [#14141](https://github.com/nushell/nushell/pull/14141), `open --raw` now sets the `content-type` in the pipeline metadata for `nu`, `nuon`, and `json` files.

### `help`

The `help` output for commands now shows the command type in parenthesis after the command name (i.e., `plugin`, `alias`, or `custom`). Currently, the command type is not displayed for `built-in`, `keyword`, or known `external` commands ([#14165](https://github.com/nushell/nushell/pull/14165)).

## Breaking changes [[toc](#table-of-content)]

### Lone, leading pipe in closures

Currently, a leading pipe character is allowed for pipelines in Nushell:

```nu
| ls
```

The closure syntax also uses pipe characters, so the parser previously allowed some cursed code:

```nu
{ |a $a }
{ |a, b $a $b }
```

Thanks to [@sgvictorino](https://github.com/sgvictorino) in [#14095](https://github.com/nushell/nushell/pull/14095), unmatched leading pipe characters in closures are no longer allowed to prevent this potential ambiguity.

```nu
{ |a| $a } # ok
{ |a $a } # now errors
```

## Deprecations [[toc](#table-of-content)]

## Removals [[toc](#table-of-content)]

## Bug fixes and other changes [[toc](#table-of-content)]

<!-- NOTE: to start investigating the contributions of last release, i like to list them all in a raw table.
to achieve this, one can use the [`list-merged-prs` script from `nu_scripts`](https://github.com/nushell/nu_scripts/blob/main/make_release/release-note/list-merged-prs)
as follows:
### `return`

```nushell
use ./make_release/release-note/list-merged-prs
use std clip

let last_release_date = ^gh api /repos/nushell/nushell/releases
| from json
| into datetime published_at
| get published_at
| sort
| last

let prs = list-merged-prs nushell/nushell $last_release_date
| sort-by mergedAt
| update url {|it| $"[#($it.number)]\(($it.url)\)" }
| update author { $"[@($in)]\(https://github.com/($in)\)" }
| select author title url
| rename -c {url: pr}
| to md --pretty

$prs | to md --pretty | clip
```
-->
In [#14120](https://github.com/nushell/nushell/pull/14120), a bug was fixed were `return`, `break`, and `continue` would set the last exit code to 1.

### `to text`

`to text` would previously have different behavior for list values and streaming list input. This has been fixed with [#14158](https://github.com/nushell/nushell/pull/14158), and the behavior for list streams is now used for list values.

### `use`

When importing a module that defines no constants, an empty record variable is no longer created ([#14051](https://github.com/nushell/nushell/pull/14051)).

### `transpose`

With [#14096](https://github.com/nushell/nushell/pull/14096), `transpose` now bubbles up any top-level errors it encounters in its input thanks to [@PhotonBursted](https://github.com/PhotonBursted).

### Constants with type signatures

Thanks to [@sgvictorino](https://github.com/sgvictorino) in [#14118](https://github.com/nushell/nushell/pull/14118), a compiler bug preventing imports of constants with type signatures has been fixed.

### Short flag type checking

Short flags for commands were previously not being typed checked. This has been fixed in [#14074](https://github.com/nushell/nushell/pull/14074) thanks to [@sgvictorino](https://github.com/sgvictorino).

### `in $range`

The step value for ranges was previously not taken into account when checking if a value was `in` a range. Thanks to [@JoaquinTrinanes](https://github.com/JoaquinTrinanes), this has been fixed with [#14011](https://github.com/nushell/nushell/pull/14011).

### `clear`

On some terminals, `clear` would behave weirdly if used in a series of commands. Thanks to [@NotTheDr01ds](https://github.com/NotTheDr01ds), this has been fixed in [#14181](https://github.com/nushell/nushell/pull/14181).

### Panic fixes

A parser panic regarding redirections was fixed in [#14035](https://github.com/nushell/nushell/pull/14035) thanks to [@Kither12](https://github.com/Kither12).

# Notes for plugin developers [[toc](#table-of-content)]

# Hall of fame [[toc](#table-of-content)]

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

| author | title | url |
| ------------------------------------ | ----------- | ------------------------------------------------------- |
| [@author](https://github.com/author) | ... | [#12345](https://github.com/nushell/nushell/pull/12345) |
| author | title | url |
| ------------------------------------ | ----- | ------------------------------------------------------- |
| [@author](https://github.com/author) | ... | [#12345](https://github.com/nushell/nushell/pull/12345) |

<!--
TODO

https://github.com/nushell/nushell/pull/14108
https://github.com/nushell/nushell/pull/14128
https://github.com/nushell/nushell/pull/14229
https://github.com/nushell/nushell/pull/14230
https://github.com/nushell/nushell/pull/14291
-->

# Full changelog [[toc](#table-of-content)]

<!-- TODO:
paste the output of
```nu
./make_release/release-note/get-full-changelog
```
here
-->
-->