Skip to content

Commit 75916ef

Browse files
committed
colorize some examples
1 parent 8c60f25 commit 75916ef

File tree

1 file changed

+30
-35
lines changed

1 file changed

+30
-35
lines changed

blog/2025-10-14-nushell_v0_108_0.md

Lines changed: 30 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -889,16 +889,18 @@ If you are manually building Nushell without default features (`cargo build --no
889889
### Improved error messages for binary literals
890890
Previously, a generic shell error is thrown for invalid binary strings. Now, an improve error message is thrown for invalid binary, hexadecimal, and octal strings.
891891
```nushell
892-
> 0b[121]
893-
# => Error: nu::parser::invalid_binary_string
894-
# =>
895-
# => × Invalid binary string.
896-
# => ╭─[entry #1:1:1]
897-
# => 1 │ 0b[121]
898-
# => · ───┬───
899-
# => · ╰── invalid binary string
900-
# => ╰────
901-
# => help: binary strings may contain only 0 or 1.
892+
0b[121]
893+
```
894+
```ansi:no-line-numbers
895+
Error: nu::parser::invalid_binary_string
896+
897+
 × Invalid binary string.
898+
╭─[entry #3:1:1]
899+
1 │ 0b[121]
900+
· ───┬───
901+
 · ╰── invalid binary string
902+
 ╰────
903+
 help: binary strings may contain only 0 or 1.
902904
```
903905

904906
### Polars 50.1 upgrade
@@ -927,31 +929,32 @@ toolkit run pr <number>
927929

928930
### Additional changes
929931

930-
* The `which` command now lists all commands (internal and external) when no application parameter is passed to it ([#16551](https://github.com/nushell/nushell/pull/16551))
932+
* The `which` command now lists all commands (internal and external) when no argument is passed to it ([#16551](https://github.com/nushell/nushell/pull/16551))
933+
931934
## Bug fixes
932935

933936
### Discard `path add` input
934-
Previously `std path add` could fail if it was fed `any` input. Example:
935-
936-
```console
937-
ls | each {} | path add
938-
Error: nu::shell::incompatible_parameters
937+
Previously `path add` (from `std/util`) could fail if it was fed `any` input.
938+
```ansi:no-line-numbers
939+
[96m> [22;1;36muse[22;39m [32mstd/util[39m [32m'path add'
940+
[96m> [22;1;36mls[22;39m [22;1;35m|[22;39m [22;1;36meach[22;39m [22;1;32m{}[22;39m [22;1;35m|[22;39m [22;1;36mpath add
941+
[22;39mError: [31mnu::shell::incompatible_parameters
939942
940-
× Incompatible parameters.
941-
╭─[std/util/mod.nu:18:17]
942-
17 │ ]: [nothing -> nothing, nothing -> list<path>] {
943-
18 │ let span = (metadata $paths).span
944-
· ────┬─── ───┬──
945-
· ╰── but a positional metadata expression was also given
946-
· ╰── pipeline input was provided
947-
19 │ let paths = $paths | flatten
948-
╰────
943+
[39m [31m×[39m Incompatible parameters.
944+
╭─[[22;1;36;4mstd/util/mod.nu:18:17[22;39;24m]
945+
[22;2m17[22m │ ]: [nothing -> nothing, nothing -> list<path>] {
946+
[22;2m18[22m │ let span = (metadata $paths).span
947+
· [22;1;35m ────┬───[33m ───┬──
948+
[22;39m · [22;1;35m│[22;39m [22;1;33m╰── but a positional metadata expression was also given
949+
[22;39m · [22;1;35m╰── pipeline input was provided
950+
[22;39m [22;2m19[22m │ let paths = $paths | flatten
951+
╰────[0m
949952
```
950953

951-
Now any input to `std path add` will be discarded. It's still possible to pass it with `$in`:
954+
Now any input to `path add` will be discarded. It's still possible to pass it with `$in`:
952955

953956
```nushell
954-
[a b c] | each {|p| $env.HOME | path join $p } | std path add $in
957+
[a b c] | each {|p| $env.HOME | path join $p } | path add $in
955958
```
956959

957960
### Aliases are now expanded before being sent to external completers
@@ -1001,14 +1004,6 @@ get_type # list<any> -> list<record<baz: int>>
10011004

10021005
Previously this error wasn't caught during compilation, and manifested as a runtime error when the execution reached the invalid `break`/`continue` call.
10031006

1004-
::: center
1005-
1006-
Hello
1007-
1008-
Hi
1009-
1010-
:::
1011-
10121007
```ansi:no-line-numbers title="Before"
10131008
> let fn = { break }
10141009
> do $fn

0 commit comments

Comments
 (0)