Skip to content

Commit 3d91884

Browse files
committed
Merge branch 'main' into release-notes-0.96.0
2 parents a043ade + f3b5fe0 commit 3d91884

File tree

552 files changed

+758
-1219
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

552 files changed

+758
-1219
lines changed

blog/2024-06-25-nushell_0_95_0.md

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ As part of this release, we also publish a set of optional plugins you can insta
2525
- [_Plugin version reporting_](#plugin-version-reporting-toc)
2626
- [_New `$nu.data-dir` and `$nu.cache-dir` constants_](#new-nudata-dir-and-nucache-dir-constants)
2727
- [_Changes to commands_](#changes-to-commands-toc)
28-
- [_Additions_](#additions-toc)
2928
- [_Breaking changes_](#breaking-changes-toc)
3029
- [_`path type`_](#path-type-toc)
3130
- [_`to toml`_](#to-toml-toc)
@@ -111,7 +110,7 @@ If not using the Rust plugin API, you need to implement the new [`Metadata`](/co
111110

112111
## New `$nu.data-dir` and `$nu.cache-dir` Constants
113112

114-
To standardize the locations for user-level items such as completions, the constant `$nu.data-dir` has been introduced. The default value of `NU_LIB_DIRS` will now be:
113+
To standardize the locations for user-level items such as completions, the constant `$nu.data-dir` has been introduced in [#13122](https://github.com/nushell/nushell/pull/13122). The default value of `NU_LIB_DIRS` will now be:
115114

116115
```nushell
117116
$env.NU_LIB_DIRS = [
@@ -122,25 +121,25 @@ $env.NU_LIB_DIRS = [
122121

123122
### Data Directory Locations
124123

125-
The location of the data directory will vary based on the operating system:
124+
If the `$XDG_DATA_HOME` environment variable is present when nushell is launched, and it is a valid path, then the data directory will `$XDG_DATA_HOME/nushell`. Otherwise, the location of the data directory will vary based on the operating system:
126125

127-
| Platform | Value | Example |
128-
| -------- | -------------------------------------------------------- | ------------------------------------------------- |
129-
| Linux | `$XDG_DATA_HOME/nushell` or `$HOME/.local/share/nushell` | `/home/alice/.local/share/nushell` |
130-
| macOS | `$HOME/Library/Application Support/nushell` | `/home/alice/Library/Application Support/nushell` |
131-
| Windows | `{FOLDERID_RoamingAppData}\nushell` | `C:\Users\Alice\AppData\Roaming\nushell` |
126+
| Platform | Value | Example |
127+
| -------- | ------------------------------------------- | ------------------------------------------------- |
128+
| Linux | `$HOME/.local/share/nushell` | `/home/alice/.local/share/nushell` |
129+
| macOS | `$HOME/Library/Application Support/nushell` | `/home/alice/Library/Application Support/nushell` |
130+
| Windows | `{FOLDERID_RoamingAppData}\nushell` | `C:\Users\Alice\AppData\Roaming\nushell` |
132131

133132
### Cache Directory Locations
134133

135-
Additionally, the constant `$nu.cache-dir` has been added for future use. The location of the cache directory will vary based on the operating system:
134+
Additionally, the constant `$nu.cache-dir` has been added for future use. Like the data directory, if the `$XDG_CACHE_HOME` variable is present and valid, then the location of the cache directory will be `$XDG_CACHE_HOME/nushell`. Otherwise, the location of the cache directory will vary based on the operating system:
136135

137-
| Platform | Value | Example |
138-
| -------- | --------------------------------------------------- | -------------------------------------- |
139-
| Linux | `$XDG_CACHE_HOME/nushell` or `$HOME/.cache/nushell` | `/home/alice/.cache/nushell` |
140-
| macOS | `$HOME/Library/Caches/nushell` | `/home/alice/Library/Caches/nushell` |
141-
| Windows | `{FOLDERID_LocalAppData}\nushell` | `C:\Users\Alice\AppData\Local\nushell` |
136+
| Platform | Value | Example |
137+
| -------- | --------------------------------- | -------------------------------------- |
138+
| Linux | `$HOME/.cache/nushell` | `/home/alice/.cache/nushell` |
139+
| macOS | `$HOME/Library/Caches/nushell` | `/home/alice/Library/Caches/nushell` |
140+
| Windows | `{FOLDERID_LocalAppData}\nushell` | `C:\Users\Alice\AppData\Local\nushell` |
142141

143-
New constants for system-level items such as $nu.vendor-autoload-dir will be introduced in future releases.
142+
New constants for system-level items such as `$nu.vendor-autoload-dir` will be introduced in future releases.
144143

145144
# Changes to commands [[toc](#table-of-content)]
146145

@@ -187,8 +186,6 @@ New constants for system-level items such as $nu.vendor-autoload-dir will be int
187186
| [@IanManske](https://github.com/IanManske) | Disallow more characters in arguments for internal `cmd` commands | [#13009](https://github.com/nushell/nushell/pull/13009) |
188187
| [@WindSoilder](https://github.com/WindSoilder) | fix do closure with both required, options, and rest args | [#13002](https://github.com/nushell/nushell/pull/13002) |
189188

190-
## Additions [[toc](#table-of-content)]
191-
192189
## Breaking changes [[toc](#table-of-content)]
193190

194191
### `path type` [[toc](#table-of-content)]
@@ -300,8 +297,7 @@ Thanks to [@abusch](https://github.com/abusch) in [#13045](https://github.com/nu
300297

301298
### `into filesize` [[toc](#table-of-content)]
302299

303-
- Thanks to [@hqsz](https://github.com/hqsz) in [#12974](https://github.com/nushell/nushell/pull/12974), `into filesize` can now parse (more) strings that start with a plus sign.
304-
- Thanks to [@hqsz](https://github.com/hqsz) in [#13110](https://github.com/nushell/nushell/pull/13110), a bug due to integer casting was fixed for `into filesize`.
300+
Thanks to [@hqsz](https://github.com/hqsz) in [#12974](https://github.com/nushell/nushell/pull/12974), `into filesize` can now parse (more) strings that start with a plus sign. In [#13110](https://github.com/nushell/nushell/pull/13110), they also fixed a bug caused by integer casting.
305301

306302
### `sys users` [[toc](#table-of-content)]
307303

book/cheat_sheet.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ use question mark operator `?` to return null instead of error if provided path
455455
> $files.name?.0?
456456
```
457457

458-
assig the result of a pipeline to a variable:
458+
assign the result of a pipeline to a variable:
459459

460460
```nu
461461
> let big_files = (ls | where size > 10kb)

book/configuration.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,14 @@ Note the `split row (char esep)` step. We need to add it because in `env.nu`, th
173173
To add multiple paths only if not already listed, one can add to `env.nu`:
174174

175175
```nu
176-
$env.PATH = $env.PATH | split row (char esep)
176+
$env.PATH = (
177+
$env.PATH
178+
| split row (char esep)
177179
| append /usr/local/bin
178180
| append ($env.CARGO_HOME | path join bin)
179181
| append ($env.HOME | path join .local bin)
180182
| uniq # filter so the paths are unique
183+
)
181184
```
182185

183186
This will add `/usr/local/bin`, the `bin` directory of CARGO_HOME, the `.local/bin` of HOME to PATH. It will also remove duplicates from PATH.

book/dataframes.md

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
# Dataframes
22

33
::: warning
4-
Starting with version 0.93, there is a more recent implementation of dataframes in `nu_plugin_polars`, which includes a newer version of `polars` and many bug fixes.
5-
From version 0.94 of Nushell, internal dataframes (with the `dfr` prefix) are going to be deprecated in favor of `nu_plugin_polars`.
64

7-
To use `nu_plugin_polars`, you'll need to install [cargo](https://doc.rust-lang.org/cargo/getting-started/installation.html) and then install the plugin with commands:
5+
To use dataframes you'll need to install [cargo](https://doc.rust-lang.org/cargo/getting-started/installation.html) and then install `nu_plugin_polars` with commands:
86

97
```nu no-run
108
# Install the `polars` nushell plugin
@@ -118,6 +116,9 @@ bench -n 10 --pretty {
118116
}
119117
}
120118
```
119+
120+
Output
121+
121122
```
122123
3sec 268ms +/- 50ms
123124
```
@@ -142,6 +143,9 @@ bench -n 10 --pretty {
142143
python load.py | null
143144
}
144145
```
146+
147+
Output
148+
145149
```
146150
1sec 322ms +/- 6ms
147151
```
@@ -169,6 +173,9 @@ bench -n 10 --pretty {
169173
nu load.nu | complete | null
170174
}
171175
```
176+
177+
Output
178+
172179
```
173180
135ms +/- 4ms
174181
```
@@ -436,6 +443,9 @@ $group
436443
(polars col float_2 | polars count)
437444
] | polars sort-by first
438445
```
446+
447+
Output
448+
439449
```
440450
╭────────────────┬─────────────────────────────────────────────────────────────────────────────────────────────────────╮
441451
│ plan │ SORT BY [col("first")] │
@@ -904,6 +914,9 @@ in column `word`
904914
```nu
905915
$df_1 | polars filter-with ($in.word | polars is-unique)
906916
```
917+
918+
Output
919+
907920
```
908921
╭───┬───────┬───────┬─────────┬─────────┬───────┬────────┬───────┬───────╮
909922
│ # │ int_1 │ int_2 │ float_1 │ float_2 │ first │ second │ third │ word │
@@ -918,6 +931,9 @@ Or all the duplicated ones
918931
```nu
919932
$df_1 | polars filter-with ($in.word | polars is-duplicated)
920933
```
934+
935+
Output
936+
921937
```
922938
╭───┬───────┬───────┬─────────┬─────────┬───────┬────────┬───────┬────────╮
923939
│ # │ int_1 │ int_2 │ float_1 │ float_2 │ first │ second │ third │ word │
@@ -994,6 +1010,9 @@ $lf_0
9941010
]
9951011
| polars collect
9961012
```
1013+
1014+
Output
1015+
9971016
```
9981017
╭───┬───┬───┬──────────┬────────╮
9991018
│ # │ a │ b │ double_a │ half_a │
@@ -1065,6 +1084,9 @@ $lf_1
10651084
]
10661085
| polars collect
10671086
```
1087+
1088+
Output
1089+
10681090
```
10691091
╭───┬──────┬─────┬──────╮
10701092
│ # │ name │ sum │ mean │
@@ -1088,6 +1110,9 @@ let group = $lf_2
10881110
10891111
$lf_2 | polars join $group name name | polars collect
10901112
```
1113+
1114+
Output
1115+
10911116
```
10921117
╭───┬──────┬───────┬─────┬──────╮
10931118
│ # │ name │ value │ sum │ mean │
@@ -1243,4 +1268,3 @@ mature.
12431268

12441269
Keep visiting this book in order to check the new things happening to
12451270
dataframes and how they can help you process data faster and efficiently.
1246-

book/how_nushell_code_gets_run.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ _Before going into examples, one note about the "dynamic" and "static" terminolo
140140

141141
By insisting on strict parse-evaluation separation, we lose much of a flexibility users expect from dynamic interpreted languages, especially other shells, such as bash, fish, zsh and others. This leads to the examples at the beginning of this page not working. Let's break them down one by one
142142

143-
_Note: The following examples use [`source`](/commands/docs/source.md), but similar conclusions apply to other commands that parse Nushell source code, such as [`use`](/commands/docs/use.md), [`overlay use`](/commands/docs/overlay_use.md), [`hide`](/commands/docs/hide.md), [`register`](/commands/docs/register.md) or [`source-env`](/commands/docs/source-env.md)._
143+
_Note: The following examples use [`source`](/commands/docs/source.md), but similar conclusions apply to other commands that parse Nushell source code, such as [`use`](/commands/docs/use.md), [`overlay use`](/commands/docs/overlay_use.md), [`hide`](/commands/docs/hide.md) or [`source-env`](/commands/docs/source-env.md)._
144144

145145
### 1. Sourcing a dynamic path
146146

book/installation.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,6 @@ Nu releases are published as source to the popular Rust package registry [crates
8282

8383
That's it! The `cargo` tool will do the work of downloading Nu and its source dependencies, building it, and installing it into the cargo bin path.
8484

85-
If you want to install with support for [dataframes](dataframes.md), you can install using the `--features=dataframe` flag.
86-
87-
@[code](@snippets/installation/cargo_install_nu_more_features.sh)
88-
8985
### Building from the GitHub repository
9086

9187
You can also build Nu from the latest source on GitHub. This gives you immediate access to the latest features and bug fixes. First, clone the repo:

book/operators.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,10 @@ Operators are usually case-sensitive when operating on strings. There are a few
112112
"FOO" =~ "(?i)foo" # returns true
113113
```
114114

115-
2. Use the [`str contains`](/commands/docs/str_contains.md) command's `--insensitive` flag:
115+
2. Use the [`str contains`](/commands/docs/str_contains.md) command's `--ignore-case` flag:
116116

117117
```nu
118-
"FOO" | str contains --insensitive "foo"
118+
"FOO" | str contains --ignore-case "foo"
119119
```
120120

121121
3. Convert strings to lowercase with [`str downcase`](/commands/docs/str_downcase.md) before comparing:

commands/docs/alias.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22
title: alias
33
categories: |
44
core
5-
version: 0.94.0
5+
version: 0.95.0
66
core: |
77
Alias a command (with optional flags) to a new name.
88
usage: |
99
Alias a command (with optional flags) to a new name.
10-
feature: default
1110
---
1211
<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. -->
1312

commands/docs/all.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22
title: all
33
categories: |
44
filters
5-
version: 0.94.0
5+
version: 0.95.0
66
filters: |
77
Test if every element of the input fulfills a predicate expression.
88
usage: |
99
Test if every element of the input fulfills a predicate expression.
10-
feature: default
1110
---
1211
<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. -->
1312

commands/docs/ansi.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22
title: ansi
33
categories: |
44
platform
5-
version: 0.94.0
5+
version: 0.95.0
66
platform: |
77
Output ANSI codes to change color and style of text.
88
usage: |
99
Output ANSI codes to change color and style of text.
10-
feature: default
1110
---
1211
<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. -->
1312

commands/docs/ansi_gradient.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22
title: ansi gradient
33
categories: |
44
platform
5-
version: 0.94.0
5+
version: 0.95.0
66
platform: |
77
Add a color gradient (using ANSI color codes) to the given string.
88
usage: |
99
Add a color gradient (using ANSI color codes) to the given string.
10-
feature: default
1110
---
1211
<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. -->
1312

commands/docs/ansi_link.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22
title: ansi link
33
categories: |
44
platform
5-
version: 0.94.0
5+
version: 0.95.0
66
platform: |
77
Add a link (using OSC 8 escape sequence) to the given string.
88
usage: |
99
Add a link (using OSC 8 escape sequence) to the given string.
10-
feature: default
1110
---
1211
<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. -->
1312

commands/docs/ansi_strip.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22
title: ansi strip
33
categories: |
44
platform
5-
version: 0.94.0
5+
version: 0.95.0
66
platform: |
77
Strip ANSI escape sequences from a string.
88
usage: |
99
Strip ANSI escape sequences from a string.
10-
feature: default
1110
---
1211
<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. -->
1312

commands/docs/any.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22
title: any
33
categories: |
44
filters
5-
version: 0.94.0
5+
version: 0.95.0
66
filters: |
77
Tests if any element of the input fulfills a predicate expression.
88
usage: |
99
Tests if any element of the input fulfills a predicate expression.
10-
feature: default
1110
---
1211
<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. -->
1312

commands/docs/append.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22
title: append
33
categories: |
44
filters
5-
version: 0.94.0
5+
version: 0.95.0
66
filters: |
77
Append any number of rows to a table.
88
usage: |
99
Append any number of rows to a table.
10-
feature: default
1110
---
1211
<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. -->
1312

commands/docs/ast.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22
title: ast
33
categories: |
44
debug
5-
version: 0.94.0
5+
version: 0.95.0
66
debug: |
77
Print the abstract syntax tree (ast) for a pipeline.
88
usage: |
99
Print the abstract syntax tree (ast) for a pipeline.
10-
feature: default
1110
---
1211
<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. -->
1312

commands/docs/bits.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22
title: bits
33
categories: |
44
bits
5-
version: 0.94.0
5+
version: 0.95.0
66
bits: |
77
Various commands for working with bits.
88
usage: |
99
Various commands for working with bits.
10-
feature: default
1110
---
1211
<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. -->
1312

commands/docs/bits_and.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22
title: bits and
33
categories: |
44
bits
5-
version: 0.94.0
5+
version: 0.95.0
66
bits: |
77
Performs bitwise and for ints or binary values.
88
usage: |
99
Performs bitwise and for ints or binary values.
10-
feature: default
1110
---
1211
<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. -->
1312

0 commit comments

Comments
 (0)