Skip to content

Commit d24257c

Browse files
committed
Darren's changes
1 parent 87a3ff6 commit d24257c

File tree

1 file changed

+53
-40
lines changed

1 file changed

+53
-40
lines changed

blog/2024-12-24-nushell_0_101_0.md

Lines changed: 53 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,26 @@ With [#14625](https://github.com/nushell/nushell/pull/14625), the Nushell versio
191191

192192
Thanks to [@WindSoilder](https://github.com/WindSoilder) in [#14374](https://github.com/nushell/nushell/pull/14374), the `input` command now has a `--default` parameter to set a default value when none is provided in the input.
193193

194+
### PowerShell script invocation on Windows
195+
196+
With [#14379](https://github.com/nushell/nushell/pull/14379) by [@fdncred](https://github.com/fdncred) we now launch PowerShell scripts with a `.ps1` extension directly through `powershell.exe`. This behavior follows the same logic we offer for scripts launched by `cmd.exe`.
197+
198+
### New introspection tools
199+
200+
[@fdncred](https://github.com/fdncred) added a series of new tools permitting you to inspect internals of Nushell's engine for better understanding or debugging. We hope you can put them to good use to drill down into bugs or to learn more how the Nushell engine understands a piece of code or represents your current state. As they refer to the engine internals we still want to actively evolve their output or behavior may change as we continue development. So don't depend on them in scripts but feel free to use them to diagnose issues or learn about the behavior of the current version.
201+
202+
#### [`view source` now supports internal IDs](https://github.com/nushell/nushell/pull/14609)
203+
To access the content of closures or other code `view source` can now accept an integer ID which represents the internal `BlockId` to access the code stored there. This is useful whenever our output provided you with `<Closure {BlockID}>`. For closures stored in a variable you can still access it directly via `view source`.
204+
205+
#### [`view blocks`](https://github.com/nushell/nushell/pull/14610)
206+
This new commands lists the raw code blocks as stored in the engine after parsing including `block_id`, source code, and spans.
207+
208+
#### [`ast --flatten`](https://github.com/nushell/nushell/pull/14400)
209+
The `ast` command can now also output the flattened and simplified representation of the AST used by syntax highlighting and some of the completion logic. This is accessible through the `--flatten` flag.
210+
211+
#### [`config flatten`](https://github.com/nushell/nushell/pull/14621)
212+
To see the whole configuration in a simplified representation, especially to spot differences between different user configurations, `config flatten` provides a simplified view that is not nested like `$env.config`. Note that this output is not directly compatible with the config record and may not have the correct types.
213+
194214
## Breaking changes
195215

196216
### `++` operator
@@ -435,6 +455,24 @@ Previously the output logic would invoke `table` regardless on top of the format
435455

436456
Thanks to [@WindSoilder](https://github.com/WindSoilder) in [#14407](https://github.com/nushell/nushell/pull/14407), the `du` command shows a more condensed output by default. The `files` and (recursive) `directories` are not shown by default. Use `du --long (-l)` to show these columns. The `--all (-a)` switch has been removed -- Files and directories will both be shown with `--long (-l)`.
437457

458+
### Code specific environment variables updated during `source`
459+
The variables `$env.CURRENT_FILE` and `$env.FILE_PWD` had already been set to the respective file paths whenever a script was executed or module loaded. Similarly `$env.PROCESS_PATH` is set for the execution of a script or module but unset when a module is `use`d.
460+
461+
With [#14486](https://github.com/nushell/nushell/pull/14486) by [@fdncred](https://github.com/fdncred) `$env.CURRENT_FILE` and `$env.FILE_PWD` will now also be updated when a particular file is included via `source`. Similarly `$env.PROCESS_PATH` will be unset.
462+
463+
```nushell
464+
# test_source.nu
465+
print $"$env.CURRENT_FILE = ($env.CURRENT_FILE?)"
466+
print $"$env.FILE_PWD = ($env.FILE_PWD?)"
467+
print $"$env.PROCESS_PATH = ($env.PROCESS_PATH?)"
468+
```
469+
``` nushell
470+
source test_source.nu
471+
# => $env.CURRENT_FILE = /Users/fdncred/src/nushell/test_source.nu
472+
# => $env.FILE_PWD = /Users/fdncred/src/nushell
473+
# => $env.PROCESS_PATH =
474+
```
475+
438476
## Deprecations
439477

440478
### `split-by`
@@ -523,7 +561,6 @@ Thanks to all the contributors below for helping us solve issues, improve docume
523561

524562
| author | title | link |
525563
| ------ | ----- | ---- |
526-
527564
|[@132ikl](https://github.com/132ikl)|Rely on `display_output` hook for formatting values from evaluations|[#14361](https://github.com/nushell/nushell/pull/14361)|
528565
|[@132ikl](https://github.com/132ikl)|Make length only operate on supported input types|[#14475](https://github.com/nushell/nushell/pull/14475)|
529566
|[@132ikl](https://github.com/132ikl)|Add label rendering to try/catch rendered errors|[#14477](https://github.com/nushell/nushell/pull/14477)|
@@ -549,9 +586,7 @@ Thanks to all the contributors below for helping us solve issues, improve docume
549586
|[@DziubaMaksym](https://github.com/DziubaMaksym)|fix: sample_config|[#14465](https://github.com/nushell/nushell/pull/14465)|
550587
|[@IanManske](https://github.com/IanManske)|Deprecate `split-by` command|[#14019](https://github.com/nushell/nushell/pull/14019)|
551588
|[@IanManske](https://github.com/IanManske)|Change append operator to concatenation operator|[#14344](https://github.com/nushell/nushell/pull/14344)|
552-
553-
<!-- |[@IanManske](https://github.com/IanManske)|Make `Hooks` fields non-optional to match the new config defaults|[#14345](https://github.com/nushell/nushell/pull/14345)| -->
554-
589+
|[@IanManske](https://github.com/IanManske)|Make `Hooks` fields non-optional to match the new config defaults|[#14345](https://github.com/nushell/nushell/pull/14345)|
555590
|[@IanManske](https://github.com/IanManske)|Add `Filesize` type|[#14369](https://github.com/nushell/nushell/pull/14369)|
556591
|[@IanManske](https://github.com/IanManske)|Remove `ListStream` type|[#14425](https://github.com/nushell/nushell/pull/14425)|
557592
|[@IanManske](https://github.com/IanManske)|Make `timeit` take only closures as an argument|[#14483](https://github.com/nushell/nushell/pull/14483)|
@@ -632,35 +667,25 @@ Thanks to all the contributors below for helping us solve issues, improve docume
632667
|[@cptpiepmatz](https://github.com/cptpiepmatz)|Fix `commands::network::http::*::*_timeout` tests on non-english system|[#14640](https://github.com/nushell/nushell/pull/14640)|
633668
|[@devyn](https://github.com/devyn)|Remove the `NU_DISABLE_IR` option|[#14293](https://github.com/nushell/nushell/pull/14293)|
634669
|[@devyn](https://github.com/devyn)|Turn compile errors into fatal errors|[#14388](https://github.com/nushell/nushell/pull/14388)|
635-
636-
<!-- |[@fdncred](https://github.com/fdncred)|allow nuscripts to be run again on windows with assoc/ftype|[#14318](https://github.com/nushell/nushell/pull/14318)| -->
637-
<!-- |[@fdncred](https://github.com/fdncred)|fix ansi bleed over on right prompt|[#14357](https://github.com/nushell/nushell/pull/14357)| -->
638-
670+
|[@fdncred](https://github.com/fdncred)|allow nuscripts to be run again on windows with assoc/ftype|[#14318](https://github.com/nushell/nushell/pull/14318)|
671+
|[@fdncred](https://github.com/fdncred)|fix ansi bleed over on right prompt|[#14357](https://github.com/nushell/nushell/pull/14357)|
639672
|[@fdncred](https://github.com/fdncred)|update uutils crates|[#14371](https://github.com/nushell/nushell/pull/14371)|
640-
641-
<!-- |[@fdncred](https://github.com/fdncred)|allow ps1 files to be executed without pwsh/powershell -c file.ps1|[#14379](https://github.com/nushell/nushell/pull/14379)| -->
642-
<!-- |[@fdncred](https://github.com/fdncred)|add function to make env vars case-insensitive|[#14390](https://github.com/nushell/nushell/pull/14390)| -->
643-
<!-- |[@fdncred](https://github.com/fdncred)|add new --flatten parameter to the ast command|[#14400](https://github.com/nushell/nushell/pull/14400)| -->
644-
673+
|[@fdncred](https://github.com/fdncred)|allow ps1 files to be executed without pwsh/powershell -c file.ps1|[#14379](https://github.com/nushell/nushell/pull/14379)|
674+
|[@fdncred](https://github.com/fdncred)|add function to make env vars case-insensitive|[#14390](https://github.com/nushell/nushell/pull/14390)|
675+
|[@fdncred](https://github.com/fdncred)|add new --flatten parameter to the ast command|[#14400](https://github.com/nushell/nushell/pull/14400)|
645676
|[@fdncred](https://github.com/fdncred)|remove `terminal_size` crate everywhere it makes sense|[#14423](https://github.com/nushell/nushell/pull/14423)|
646677
|[@fdncred](https://github.com/fdncred)|update rust toolchain to rust 1.81.0|[#14473](https://github.com/nushell/nushell/pull/14473)|
647-
648-
<!-- |[@fdncred](https://github.com/fdncred)|Add environment variables for sourced files|[#14486](https://github.com/nushell/nushell/pull/14486)| -->
649-
<!-- |[@fdncred](https://github.com/fdncred)|allow `select` to stream more|[#14492](https://github.com/nushell/nushell/pull/14492)| -->
650-
<!-- |[@fdncred](https://github.com/fdncred)|add file column to `scope modules` output|[#14524](https://github.com/nushell/nushell/pull/14524)| -->
651-
678+
|[@fdncred](https://github.com/fdncred)|Add environment variables for sourced files|[#14486](https://github.com/nushell/nushell/pull/14486)|
679+
|[@fdncred](https://github.com/fdncred)|allow `select` to stream more|[#14492](https://github.com/nushell/nushell/pull/14492)|
680+
|[@fdncred](https://github.com/fdncred)|add file column to `scope modules` output|[#14524](https://github.com/nushell/nushell/pull/14524)|
652681
|[@fdncred](https://github.com/fdncred)|update to reedline 9eb3c2d|[#14541](https://github.com/nushell/nushell/pull/14541)|
653-
654-
<!-- |[@fdncred](https://github.com/fdncred)|fix 64-bit hex number parsing|[#14571](https://github.com/nushell/nushell/pull/14571)| -->
655-
682+
|[@fdncred](https://github.com/fdncred)|fix 64-bit hex number parsing|[#14571](https://github.com/nushell/nushell/pull/14571)|
656683
|[@fdncred](https://github.com/fdncred)|tweak polars join for better cross joins|[#14586](https://github.com/nushell/nushell/pull/14586)|
657-
658-
<!-- |[@fdncred](https://github.com/fdncred)|allow `view source` to take `int` as a parameter|[#14609](https://github.com/nushell/nushell/pull/14609)| -->
659-
<!-- |[@fdncred](https://github.com/fdncred)|add `view blocks` command|[#14610](https://github.com/nushell/nushell/pull/14610)| -->
660-
<!-- |[@fdncred](https://github.com/fdncred)|add `config flatten` command|[#14621](https://github.com/nushell/nushell/pull/14621)| -->
661-
<!-- |[@fdncred](https://github.com/fdncred)|better error handling for `view source`|[#14624](https://github.com/nushell/nushell/pull/14624)| -->
662-
<!-- |[@fdncred](https://github.com/fdncred)|lookup closures/blockids and get content in `config flatten`|[#14635](https://github.com/nushell/nushell/pull/14635)| -->
663-
684+
|[@fdncred](https://github.com/fdncred)|allow `view source` to take `int` as a parameter|[#14609](https://github.com/nushell/nushell/pull/14609)|
685+
|[@fdncred](https://github.com/fdncred)|add `view blocks` command|[#14610](https://github.com/nushell/nushell/pull/14610)|
686+
|[@fdncred](https://github.com/fdncred)|add `config flatten` command|[#14621](https://github.com/nushell/nushell/pull/14621)|
687+
|[@fdncred](https://github.com/fdncred)|better error handling for `view source`|[#14624](https://github.com/nushell/nushell/pull/14624)|
688+
|[@fdncred](https://github.com/fdncred)|lookup closures/blockids and get content in `config flatten`|[#14635](https://github.com/nushell/nushell/pull/14635)|
664689
|[@fdncred](https://github.com/fdncred)|tweaks to `config flatten`|[#14639](https://github.com/nushell/nushell/pull/14639)|
665690
|[@hustcer](https://github.com/hustcer)|Bump to dev version 0.100.1|[#14328](https://github.com/nushell/nushell/pull/14328)|
666691
|[@hustcer](https://github.com/hustcer)|Fix the document CI error for `polars profile` command|[#14642](https://github.com/nushell/nushell/pull/14642)|
@@ -694,15 +719,3 @@ Thanks to all the contributors below for helping us solve issues, improve docume
694719
|[@ysthakur](https://github.com/ysthakur)|Avoid recomputing fuzzy match scores|[#13700](https://github.com/nushell/nushell/pull/13700)|
695720
|[@ysthakur](https://github.com/ysthakur)|fix: Respect sort in custom completions|[#14424](https://github.com/nushell/nushell/pull/14424)|
696721
|[@zhiburt](https://github.com/zhiburt)|nu-table/ Do footer_inheritance by accounting for rows rather then a f…|[#14380](https://github.com/nushell/nushell/pull/14380)|
697-
698-
<!-- TODO:
699-
- `use nu_scripts/make_release/release-note/notes.nu *`
700-
- run `list-prs --milestone v0.101.0 | pr-table`
701-
- paste the output here
702-
703-
Afterwards, go through each PR and classify it as one of the following:
704-
- A user-facing change. These PRs should go into the `# Changes` section.
705-
- A plugin-facing change. These PRs should go in `# Notes for plugin developers`. Some plugin-facing changes might also be a user-facing change and vice versa.
706-
- A documentation improvement, error message improvement, refactoring PR, clippy fix, typo fix, etc. These PRs go into the `# Hall of fame`. You can just copy the table row in this section and paste it to the `# Hall of fame` section above. Note that major refactorings may warrant a section in `# Highlights`.
707-
- Dependabot PRs and version bumps should be ignored. They will only be mentioned in `# Full changelog`.
708-
-->

0 commit comments

Comments
 (0)