Skip to content

feat/mcp repl state#1

Closed
andrewgazelka wants to merge 165 commits into
mainfrom
feat/mcp-repl-state
Closed

feat/mcp repl state#1
andrewgazelka wants to merge 165 commits into
mainfrom
feat/mcp-repl-state

Conversation

@andrewgazelka
Copy link
Copy Markdown
Owner

Bahex and others added 30 commits September 29, 2025 20:49
…6764)

- fixes nushell#16073

## Release notes summary - What our users need to know

### `for` and `while` loop blocks starting with a range literal no
longer causes a compiler error

## Tasks after submitting
N/A
## Problem
Eagerly compiling blocks results in compiling them multiple times since
most of them (all control flow blocks) are actually inlined.

## Solution
Defer compiling blocks until their parent expression is compiled, during
which they are inlined.

### Exceptions - Eagerly Compiled Blocks:
Top level blocks, i.e. blocks that aren't inlined into a parent block
are the entry points for compilation.
- Script files
- Command definitions (`def`)
- `export-env` blocks
- `closure`s

## Release notes summary - What our users need to know
N/A

## Tasks after submitting
N/A
- fixed an issue with the next_cursor showing up when it shouldn't in
the pagination results
- Added a carriage return between result rows
- Tweaked prompts
- merged find_command and list_command into one tool

---------

Co-authored-by: Jack Wright <jack.wright@nike.com>
This PR adds the `--chars` flag to the `str length` command.

Partially addresses nushell#16342 but
doesn't make `--chars` the default so we can avoid a breaking change.

## Release notes summary - What our users need to know

The `str length` command now has a `--chars` flag to allow you to count
characters.

```nushell
> 'hällo' | str length --chars
  5
```

## Tasks after submitting
N/A
Also wrapped some string literals that were over `rustfmt`'s max line
length.
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tim 'Piepmatz' Hesse <git+github@cptpiepmatz.de>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
- Updated schema urls to use `rust_rule`, which provides tree-sitter
node name completions.
- Added tests for all existing lints.
- Ran tests and generated snapshots
- closes nushell#14504
- closes nushell#14806
- partially addresses nushell#5035

---

Added `attr complete external`, which enables using the external
completer for `extern` and custom command `def`initions:

```nushell
@complete external
def --wrapped jc [...args] {
    ^jc ...$args | from json
}
```

Added `attr complete` which uses another command (similar to the `arg:
string@"command"`) to provide completions for _all arguments_ of a
command:

```nushell
def fish-completer [spans: list<string>] {
	^fish ...
}

def carapace-completer [spans: list<string>] {
    ^carapace ...
}

@complete fish-completer
extern git []

@complete carapace-completer
def --env get-env [name] { $env | get $name }

@complete carapace-completer
def --env set-env [name, value] { load-env { $name: $value } }

@complete carapace-completer
def --env unset-env [name] { hide-env $name }
```


Also includes the following bugfix:

- `spans: list<string>` argument provided to the external completer (and
completer commands used with `attr complete` with this addition)
previously had invalid spans (from `Span::unknown`).
These values now have correct spans pointing to their location in the
source code.
## Release notes summary - What our users need to know
* On Windows, UNC and device paths no longer get a trailing `\` appended
when being cast to `path`
* On Windows, open, save and source now work with device paths like
`\\.\NUL` or `\\.\CON`, as well as reserved device names like `NUL` and
`CON`. Using full device paths is recommended.

## Tasks after submitting
<!--
Thank you for improving Nushell!
Please, read our contributing guide:
https://github.com/nushell/nushell/blob/main/CONTRIBUTING.md
-->

## Release notes summary - What our users need to know
Now `into string` accepts a `cell-path` as input.

## Tasks after submitting
This PR updates nushell to the latest reedline commit 32e82c27.

Notes from @JonLD regarding reedline's new `TextObject`, reedline change
author of nushell/reedline#939 and
nushell/reedline#957 and nushell#16808

Since EditCommand contains a TextObject and not a string it is not
possible for the user to directly there needs to be a bit of work done
to construct the relevant text object. Maintains the edit command names,
seen under "keybindings list", of CutTextObject and CopyTextObject and
using scope: <inner|around> and the object_type: mirrors the Reedline
implementation and the informative error messages should help signal to
users what are valid inputs. Ideally the "keybindings list" would be a
bit mor informative as to how to set up specific keybindings but that's
not currently possible, and perhaps not even necessary.
The alternative would be to set up edit commands for each text object,
this would be a larger Reedline change and add unecessary complexity to
Reedline but would expose the commands better to the use. You could just
add them in this file and keep Reedline as is but that would not be
exposed to the user via "keybindings list" as this command lists the
actual enums and not commands set up in the reedline_config.rs.

## Release notes summary - What our users need to know
Breaking change since the reedline change renames `cutinside` and
`yankinside`. The PR adds these new EditCommands:
- cutinsidepair
- copyinsidepair
- cutaroundpair
- copyaroundpair
- cuttextobject
- copytextobject

## Tasks after submitting
N/A
Recently `hover_on_external_command` has been timing out and failing CI
runs.

is 10 seconds long? yeah. is it quicker than re-running ci jobs? also
yeah.
Cleans up input output types ahead of the nushell#16079 

There will possibly be more breakages, this however should fix most of
them. There is only one user facing changes. The polars types will now
be prefixed with polars_ (e.g. polars_dataframe)

---------

Co-authored-by: Jack Wright <jack.wright@nike.com>
This PR adds the `toolkit run pr` and `toolkit download pr` commands to
`toolkit`. This is a more fleshed out version of the snippet shared in
nushell#16633, with robust error handling and cross-platform unzip support.
When using `toolkit run pr`, the script will also check if the most
recent binary for that PR has already been downloaded, and if so it will
run that instead.

I tried to make the error reporting as good as a built-in command to see
how difficult that would be, and with use of the `--head: oneof<>`
trick, it turned out pretty good. With access to the call span, the
workflow is very similar to when writing a built-in command. I also used
a `Spanned`-like record, which helped as well.

```nushell
toolkit run pr 16740
# => Error: nu::shell::error
# =>
# =>   × Command not found
# =>    ╭─[entry nushell#4:1:26]
# =>  1 │ overlay use -pr toolkit; toolkit run pr 16740
# =>    ·                          ───────┬──────
# =>    ·                                 ╰── requires `gh`
# =>    ╰────
# =>   help: Please install the `gh` commandline tool
```

<details>
<summary>More error reporting notes</summary>
In an earlier version of the script, `run pr` called `download pr`
directly. I ended up changing the way this worked so that `run pr` could
use the workflow_id. Here's a couple snippets I thought were neat from
this older version.

&nbsp;
**Passing span via `--head`:**
```nushell
def download [--head: oneof<>] {
  let span = $head | default (metadata $head).span
  error make {msg: "a", label: {text: here, span: $span}}
}

def run [--head: oneof<>] { 
  let span = (metadata $head).span
  download --head=$span
}

download
# => Error: nu:🐚:error
# => 
# =>   × a
# =>    ╭─[entry nushell#6:1:1]
# =>  1 │ download
# =>    · ────┬───
# =>    ·     ╰── here
# =>    ╰────

run
# => Error: nu:🐚:error
# => 
# =>   × a
# =>    ╭─[entry nushell#7:1:1]
# =>  1 │ run
# =>    · ─┬─
# =>    ·  ╰── here
# =>    ╰────
```

**Using "spanned" number as CLI parameter and as internal caller
parameter**

```nushell
def download [number: oneof<int, record<item: int, span: record>>] {
  let number = match $number {
    {item: $_, span: $_} => $number,
    $val => {item: $number, span: (metadata $number).span}
  }

  error make {msg: "a", label: {text: here, span: $number.span}}
}

def run [number: int] {
  let number = {item: $number, span: (metadata $number).span}
  download $number
}

download 123
# => Error: nu:🐚:error
# => 
# =>   × a
# =>    ╭─[entry nushell#9:1:10]
# =>  1 │ download 123
# =>    ·          ─┬─
# =>    ·           ╰── here
# =>    ╰────

run 123
# => Error: nu:🐚:error
# => 
# =>   × a
# =>    ╭─[entry nushell#10:1:5]
# =>  1 │ run 123
# =>    ·     ─┬─
# =>    ·      ╰── here
# =>    ╰────
```

</details>

## Release notes summary - What our users need to know
The toolkit in the Nushell repository can now download and run PRs by
downloading artifacts from CI runs. It can be run like this:
```nushell
use toolkit
toolkit run pr <number>
```
This PR removes all usages of `internal_span`. Hooray!

It also upgrades the `ast-grep` for `internal_span` from a warning to an
error, so we can prevent accidentally reintroducing `internal_span`

Related: nushell#12963
`Value` can no longer be constructed directly using struct expression
syntax outside of the defining crate (`nu-protocol`)

Now it can only be constructed using the constructor methods.


Co-authored-by: rose <132@ikl.sh>
Co-authored-by: Piepmatz <git+github@cptpiepmatz.de>
…#16821)

## Release notes summary - What our users need to know

This PR adds two related features:

1. Custom metadata via `metadata set --merge`: Attach arbitrary metadata
to pipeline data:

```nushell
"data" | metadata set --merge {custom_key: "value"} | metadata | get custom_key
```

2. Automatic HTTP response metadata: All HTTP commands now attach
response metadata under `http_response`:
   - `status` - HTTP status code
   - `headers` - Response headers as `[{name, value}, ...]`
   - `urls` - Redirect history

Access metadata after the response completes:
```nushell
http get https://api.example.com | metadata | get http_response.status
# => 200
```

Or access metadata while streaming the response body using `metadata
access`:
```nushell
http get https://api.example.com/events.jsonl
| metadata access {|meta|
    if $meta.http_response.status != 200 {
        error make {msg: "failed"}
    } else { }
  }
| lines
| each { from json }
| where event_type == "error"
```

Unlike `--full`, which consumes the entire response body, this allows
streaming while accessing metadata.

## Breaking changes

`collect` now removes `FilePath` data_source even when `content_type` is
set. Previously: both preserved. Now: `content_type` preserved,
`FilePath` cleared.

corresponding PR: nushell/nushell.github.io#2051
Bumps [rmcp](https://github.com/modelcontextprotocol/rust-sdk) from
0.7.0 to 0.8.1.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/modelcontextprotocol/rust-sdk/releases">rmcp's
releases</a>.</em></p>
<blockquote>
<h2>rmcp-macros-v0.8.1</h2>
<h3>Fixed</h3>
<ul>
<li>generate default schema for tools with no params (<a
href="https://redirect.github.com/modelcontextprotocol/rust-sdk/pull/446">#446</a>)</li>
</ul>
<h2>rmcp-v0.8.1</h2>
<h3>Fixed</h3>
<ul>
<li><em>(oauth)</em> pass bearer token to all streamable http requests
(<a
href="https://redirect.github.com/modelcontextprotocol/rust-sdk/pull/476">#476</a>)</li>
<li>fix spellcheck on intentional typo in CHANGELOG (<a
href="https://redirect.github.com/modelcontextprotocol/rust-sdk/pull/470">#470</a>)</li>
</ul>
<h2>rmcp-macros-v0.8.0</h2>
<h3>Fixed</h3>
<ul>
<li>generate default schema for tools with no params (<a
href="https://redirect.github.com/modelcontextprotocol/rust-sdk/pull/446">#446</a>)</li>
</ul>
<h2>rmcp-v0.8.0</h2>
<h3>Added</h3>
<ul>
<li>allow clients to override client_name (<a
href="https://redirect.github.com/modelcontextprotocol/rust-sdk/pull/469">#469</a>)</li>
</ul>
<h3>Fixed</h3>
<ul>
<li><em>(oauth)</em> support suffixed and preffixed well-knonw paths (<a
href="https://redirect.github.com/modelcontextprotocol/rust-sdk/pull/459">#459</a>)</li>
<li>generate default schema for tools with no params (<a
href="https://redirect.github.com/modelcontextprotocol/rust-sdk/pull/446">#446</a>)</li>
</ul>
<h3>Other</h3>
<ul>
<li>bump to rust 1.90.0 (<a
href="https://redirect.github.com/modelcontextprotocol/rust-sdk/pull/453">#453</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/modelcontextprotocol/rust-sdk/commit/c86883b81cb36963784d0213584c852e4f72a461"><code>c86883b</code></a>
chore: release v0.8.1 (<a
href="https://redirect.github.com/modelcontextprotocol/rust-sdk/issues/473">#473</a>)</li>
<li><a
href="https://github.com/modelcontextprotocol/rust-sdk/commit/923145afdcf20cdbd3df00b7f1f16028389abc66"><code>923145a</code></a>
fix(oauth): pass bearer token to all streamable http requests (<a
href="https://redirect.github.com/modelcontextprotocol/rust-sdk/issues/476">#476</a>)</li>
<li><a
href="https://github.com/modelcontextprotocol/rust-sdk/commit/34f482375c4548a630a480dd9f7c0de74681fab1"><code>34f4823</code></a>
fix: fix spellcheck on intentional typo in CHANGELOG (<a
href="https://redirect.github.com/modelcontextprotocol/rust-sdk/issues/470">#470</a>)</li>
<li><a
href="https://github.com/modelcontextprotocol/rust-sdk/commit/a4def1100de6a737c5f0f9922f846ce94a232619"><code>a4def11</code></a>
chore: release v0.7.1 (<a
href="https://redirect.github.com/modelcontextprotocol/rust-sdk/issues/454">#454</a>)</li>
<li><a
href="https://github.com/modelcontextprotocol/rust-sdk/commit/6011f34ddf522d06a5ad33d4c2f4ea4766a19901"><code>6011f34</code></a>
feat: allow clients to override client_name (<a
href="https://redirect.github.com/modelcontextprotocol/rust-sdk/issues/469">#469</a>)</li>
<li><a
href="https://github.com/modelcontextprotocol/rust-sdk/commit/c0b777c7f784ba2d456b03c2ec3b98c9b28b5e10"><code>c0b777c</code></a>
fix(ci): fix rustdoc build by scoping <code>docsrs</code> cfg to rustdoc
only (<a
href="https://redirect.github.com/modelcontextprotocol/rust-sdk/issues/458">#458</a>)</li>
<li><a
href="https://github.com/modelcontextprotocol/rust-sdk/commit/0566d132eaa9043d8c2a45a3b33b94d805f1e4d4"><code>0566d13</code></a>
fix(oauth): support suffixed and preffixed well-knonw paths (<a
href="https://redirect.github.com/modelcontextprotocol/rust-sdk/issues/459">#459</a>)</li>
<li><a
href="https://github.com/modelcontextprotocol/rust-sdk/commit/717ec56e230ce7073ec464fe0b339e0aff0b97b9"><code>717ec56</code></a>
fix: generate default schema for tools with no params (<a
href="https://redirect.github.com/modelcontextprotocol/rust-sdk/issues/446">#446</a>)</li>
<li><a
href="https://github.com/modelcontextprotocol/rust-sdk/commit/57fc428c578a1a3fe851ee0838bf068bda120eb3"><code>57fc428</code></a>
chore: bump to rust 1.90.0 (<a
href="https://redirect.github.com/modelcontextprotocol/rust-sdk/issues/453">#453</a>)</li>
<li>See full diff in <a
href="https://github.com/modelcontextprotocol/rust-sdk/compare/rmcp-v0.7.0...rmcp-v0.8.1">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=rmcp&package-manager=cargo&previous-version=0.7.0&new-version=0.8.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [shadow-rs](https://github.com/baoyachi/shadow-rs) from 1.3.0 to
1.4.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/baoyachi/shadow-rs/releases">shadow-rs's
releases</a>.</em></p>
<blockquote>
<h2>v1.4.0</h2>
<h2>What's Changed</h2>
<ul>
<li>Expand <code>print_build_in</code> functionality by <a
href="https://github.com/StratusFearMe21"><code>@​StratusFearMe21</code></a>
in <a
href="https://redirect.github.com/baoyachi/shadow-rs/pull/243">baoyachi/shadow-rs#243</a></li>
<li>Commits since tag type by <a
href="https://github.com/baoyachi"><code>@​baoyachi</code></a> in <a
href="https://redirect.github.com/baoyachi/shadow-rs/pull/246">baoyachi/shadow-rs#246</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a
href="https://github.com/StratusFearMe21"><code>@​StratusFearMe21</code></a>
made their first contribution in <a
href="https://redirect.github.com/baoyachi/shadow-rs/pull/243">baoyachi/shadow-rs#243</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/baoyachi/shadow-rs/compare/1.3.0...v1.4.0">https://github.com/baoyachi/shadow-rs/compare/1.3.0...v1.4.0</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/baoyachi/shadow-rs/commit/fa98751e0c51ba768131f56894225f3e417434ab"><code>fa98751</code></a>
Update Cargo.toml</li>
<li><a
href="https://github.com/baoyachi/shadow-rs/commit/93b9f262c94c847b843618a9a2e6af065409de71"><code>93b9f26</code></a>
Merge pull request <a
href="https://redirect.github.com/baoyachi/shadow-rs/issues/246">#246</a>
from baoyachi/commits_since_tag_type</li>
<li><a
href="https://github.com/baoyachi/shadow-rs/commit/cf678abbf1acb0f19907b3fdae8d9719a814f16c"><code>cf678ab</code></a>
fix cargo clippy</li>
<li><a
href="https://github.com/baoyachi/shadow-rs/commit/918d9d75b5a78b51cb3eb048623af0b1aed4a877"><code>918d9d7</code></a>
Change ConstVal creation to use new_usize for tag</li>
<li><a
href="https://github.com/baoyachi/shadow-rs/commit/47a76de63559dec8aa697c35a47b69d78d6b1a1d"><code>47a76de</code></a>
Add new_usize function to create ConstVal with 0</li>
<li><a
href="https://github.com/baoyachi/shadow-rs/commit/bfee69815a57ea6b97ea3ab964b97fa8524b0074"><code>bfee698</code></a>
Merge pull request <a
href="https://redirect.github.com/baoyachi/shadow-rs/issues/243">#243</a>
from StratusFearMe21/write-to-string</li>
<li><a
href="https://github.com/baoyachi/shadow-rs/commit/9ae895bcd9740e369ad5e864a973a58a248d393f"><code>9ae895b</code></a>
Clarify docs</li>
<li><a
href="https://github.com/baoyachi/shadow-rs/commit/c576bd8ee139284e606de8fce09de6c8fe1385fa"><code>c576bd8</code></a>
Allow usage of <code>core</code> instead of <code>std</code></li>
<li><a
href="https://github.com/baoyachi/shadow-rs/commit/20de4d4d393c7eb1268f1ae7bf4d6c8439a64248"><code>20de4d4</code></a>
Fix metadata being printed without metadata feature</li>
<li><a
href="https://github.com/baoyachi/shadow-rs/commit/24476c8bafca945ee61486c7846e1ff1742ae770"><code>24476c8</code></a>
Add docs to BuildInfoDisplay</li>
<li>Additional commits viewable in <a
href="https://github.com/baoyachi/shadow-rs/compare/1.3.0...v1.4.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=shadow-rs&package-manager=cargo&previous-version=1.3.0&new-version=1.4.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
- refactored how `nu!` executes commands
- commands are no longer split into lines and joined with semicolons,
they are passed verbatim to nu
  - removes the need for `pipeline()` 
- **Removed built-in string formatting from `nu!`**. Going through almost
all uses of `nu!` across the code base it became clear that:
  - built-in formatting is rarely used
  - most people are not aware of it and use `format!` anyway
- it can't be used with `"{inline}"` arguments because it's only
activated if there are extra arguments after the nu code string

## Release notes summary - What our users need to know
N/A

## Tasks after submitting
N/A
cptpiepmatz and others added 26 commits December 3, 2025 07:22
<!--
Thank you for improving Nushell!
Please, read our contributing guide:
https://github.com/nushell/nushell/blob/main/CONTRIBUTING.md
-->

## Release notes summary - What our users need to know
<!--
This section will be included as part of our release notes. See the
contributing guide for more details.
Please include only details relevant for users here. Motivation and
technical details can be added above or below this section.

You may leave this section blank until your PR is finalized. Ask a core
team member if you need help filling this section.
-->

## Tasks after submitting
<!-- Remove any tasks which aren't relevant for your PR, or add your own
-->
- [ ] Update the
[documentation](https://github.com/nushell/nushell.github.io)
Bumps [crate-ci/typos](https://github.com/crate-ci/typos) from 1.39.2 to
1.40.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/crate-ci/typos/releases">crate-ci/typos's
releases</a>.</em></p>
<blockquote>
<h2>v1.40.0</h2>
<h2>[1.40.0] - 2025-11-26</h2>
<h3>Features</h3>
<ul>
<li>Updated the dictionary with the <a
href="https://redirect.github.com/crate-ci/typos/issues/1405">November
2025</a> changes</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/crate-ci/typos/blob/master/CHANGELOG.md">crate-ci/typos's
changelog</a>.</em></p>
<blockquote>
<h2>[1.40.0] - 2025-11-26</h2>
<h3>Features</h3>
<ul>
<li>Updated the dictionary with the <a
href="https://redirect.github.com/crate-ci/typos/issues/1405">November
2025</a> changes</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/crate-ci/typos/commit/2d0ce569feab1f8752f1dde43cc2f2aa53236e06"><code>2d0ce56</code></a>
chore: Release</li>
<li><a
href="https://github.com/crate-ci/typos/commit/efbd900f8db9952781b6bd1ad83baa38ebd153e3"><code>efbd900</code></a>
chore: Release</li>
<li><a
href="https://github.com/crate-ci/typos/commit/863fd15db8bf16bfe9117ec1a83ea7b6e802e9f3"><code>863fd15</code></a>
docs: Update changelog</li>
<li><a
href="https://github.com/crate-ci/typos/commit/9a27b16791dd73549457a07f247bc4920f787919"><code>9a27b16</code></a>
Merge pull request <a
href="https://redirect.github.com/crate-ci/typos/issues/1432">#1432</a>
from epage/nov</li>
<li><a
href="https://github.com/crate-ci/typos/commit/3dbd9d4eacab7f22586ea581e4d403c3ca9dbbb7"><code>3dbd9d4</code></a>
feat(dict): November additions</li>
<li><a
href="https://github.com/crate-ci/typos/commit/a1a16c7b7c25d1c27cc750525aada8b9ae68b716"><code>a1a16c7</code></a>
Merge pull request <a
href="https://redirect.github.com/crate-ci/typos/issues/1427">#1427</a>
from deining/bump-github-action</li>
<li><a
href="https://github.com/crate-ci/typos/commit/cb8d2e78ff23c82fca05340ed256b04513d022b9"><code>cb8d2e7</code></a>
docs: Bump GitHub checkout action in 'github-action.md'</li>
<li><a
href="https://github.com/crate-ci/typos/commit/9f99fb8dfe87b8a3441863fb2e5d5da88a2aa9a2"><code>9f99fb8</code></a>
docs(ref): Clarify extend-words / extend-identifiers</li>
<li>See full diff in <a
href="https://github.com/crate-ci/typos/compare/v1.39.2...v1.40.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=crate-ci/typos&package-manager=github_actions&previous-version=1.39.2&new-version=1.40.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This PR implements `ShortReportHandler` and the associated
`ErrorStyle::Short`, allowing users to display shorter errors and save
screen space, as mentioned in the related discussion (nushell#16496).

@cptpiepmatz 

## Release notes summary - What our users need to know
Add a new `short` option for `$env.config.error_style` that displays
errors as concise, single-line messages similar to classic shells.

```
$ ll
Error: External command failed: Command `ll` not found (Did you mean `all`?)
```

## Tasks after submitting
N/A
- Fixes the `decl_id` showing up
- adds color to most of the outputs
- uses `@example` for the examples instead of a comment
- Shows submodules on `help modules ...`
- Fixes `nu-highlight` and `$in`
- Compacts the output a lot, `build-help-header` now defaults to no
newline

<!--
Thank you for improving Nushell!
Please, read our contributing guide:
https://github.com/nushell/nushell/blob/main/CONTRIBUTING.md
-->

## Release notes summary - What our users need to know
<!--
This section will be included as part of our release notes. See the
contributing guide for more details.
Please include only details relevant for users here. Motivation and
technical details can be added above or below this section.

You may leave this section blank until your PR is finalized. Ask a core
team member if you need help filling this section.
-->

## Tasks after submitting
<!-- Remove any tasks which aren't relevant for your PR, or add your own
-->
- [ ] Update the
[documentation](https://github.com/nushell/nushell.github.io)
…hell#17063)

Partially fixes nushell#17062.

This is a small change which adds checks for all potentially overflowing
duration/integer operations, in addition to the sum check added in
nushell#16594. This doesn't include floating point operations, which might
still overflow.

I also took the liberty to move the shared code into a function. It does
mean that the span message will no longer have the operation name. If
that's not acceptable, I can refactor it to use the operator name.

## Release notes summary - What our users need to know

- Multiplying duration by integers now throws an error on overflow
…shell#17075)

<!--
Thank you for improving Nushell!
Please, read our contributing guide:
https://github.com/nushell/nushell/blob/main/CONTRIBUTING.md
-->

## Release notes summary - What our users need to know
<!--
This section will be included as part of our release notes. See the
contributing guide for more details.
Please include only details relevant for users here. Motivation and
technical details can be added above or below this section.

You may leave this section blank until your PR is finalized. Ask a core
team member if you need help filling this section.
-->
This PR is intended to fix the issue with error messages documented in
nushell#16717, by sorting and deduplicating the current_type param in
check_type.rs.

Fixes nushell#16717.
## Tasks after submitting
<!-- Remove any tasks which aren't relevant for your PR, or add your own
-->
- [ ] Update the
[documentation](https://github.com/nushell/nushell.github.io)
Just uses `ends-with` and a prefix to skip the control characters at the
start of the strings

This fixes the issues that came up in nushell#17038 for being run in terminals.
This doesn't fix the underlying issue, however it does allow tests to be
run in certain terminals and still pass.

This also fixes a problem with some of the tests that load `std/log`. If
`$env.NU_LOG_FORMAT` is set in the parent shell, then these tests will
incorrectly fail. Clearing the env out before running makes these work.

<!--
Thank you for improving Nushell!
Please, read our contributing guide:
https://github.com/nushell/nushell/blob/main/CONTRIBUTING.md
-->

## Release notes summary - What our users need to know
<!--
This section will be included as part of our release notes. See the
contributing guide for more details.
Please include only details relevant for users here. Motivation and
technical details can be added above or below this section.

You may leave this section blank until your PR is finalized. Ask a core
team member if you need help filling this section.
-->

## Tasks after submitting
<!-- Remove any tasks which aren't relevant for your PR, or add your own
-->
- [ ] Update the
[documentation](https://github.com/nushell/nushell.github.io)
…ll#17106)

<!--
Thank you for improving Nushell!
Please, read our contributing guide:
https://github.com/nushell/nushell/blob/main/CONTRIBUTING.md
-->

## Release notes summary - What our users need to know
<!--
This section will be included as part of our release notes. See the
contributing guide for more details.
Please include only details relevant for users here. Motivation and
technical details can be added above or below this section.

You may leave this section blank until your PR is finalized. Ask a core
team member if you need help filling this section.
-->
Added logic to treat Missing Required Flag the same as Missing
Positional (i.e., alias parsing logic ignores those errors when returned
from parse_call). I did a scan of similar types of parse errors and
added MissingFlagParam, which I think should have the same treatment.

fixes nushell#16847 
## Tasks after submitting
<!-- Remove any tasks which aren't relevant for your PR, or add your own
-->
- [ ] Update the
[documentation](https://github.com/nushell/nushell.github.io)
<!--
Thank you for improving Nushell!
Please, read our contributing guide:
https://github.com/nushell/nushell/blob/main/CONTRIBUTING.md
-->

## Release notes summary - What our users need to know
<!--
This section will be included as part of our release notes. See the
contributing guide for more details.
Please include only details relevant for users here. Motivation and
technical details can be added above or below this section.

You may leave this section blank until your PR is finalized. Ask a core
team member if you need help filling this section.
-->
added logic to exclude parenthesized expressions in the search for the
optional second piece of a range expression, ex

```0..(1..2 | first)```

will now parse as a simple range `0..1` rather than an invalid complex range `0..(1..2`

fixes nushell#16969 

## Tasks after submitting
<!-- Remove any tasks which aren't relevant for your PR, or add your own -->
- [ ] Update the [documentation](https://github.com/nushell/nushell.github.io)
<!--
Thank you for improving Nushell!
Please, read our contributing guide:
https://github.com/nushell/nushell/blob/main/CONTRIBUTING.md
-->

It's better than
```
loop {
    try {
        job recv --tag $tag --timeout 0sec
    } catch {
        break
    }
}
```

## Release notes summary - What our users need to know
`job flush` can now take a `--tag` to filter which messages to discard
<!--
This section will be included as part of our release notes. See the
contributing guide for more details.
Please include only details relevant for users here. Motivation and
technical details can be added above or below this section.

You may leave this section blank until your PR is finalized. Ask a core
team member if you need help filling this section.
-->

## Tasks after submitting
<!-- Remove any tasks which aren't relevant for your PR, or add your own
-->
- [ ] Update the
[documentation](https://github.com/nushell/nushell.github.io)
)

Changes spans provided by custom/external completers to be relative to
the context/line provided as input to the completer. Previously, they
were relative to the entire command line, which would cause problems if
the partial command call were part of a subexpression.

For example, if the user typed `foo | bar ba<TAB>` and the completer
provided the span `{start: 0, end: 6}`, the `foo | ` bit incorrectly
gets replaced. With this PR, `bar ba` would be replaced.

To clarify, this PR does not change how `$pos` is passed to custom
completers. It only changes how spans in suggestions provided by the
completer are interpreted.

Fixes nushell#17046

## Release notes summary - What our users need to know
<!--
This section will be included as part of our release notes. See the
contributing guide for more details.
Please include only details relevant for users here. Motivation and
technical details can be added above or below this section.

You may leave this section blank until your PR is finalized. Ask a core
team member if you need help filling this section.
-->

Note to release note writers: while this changes behavior, I don't think
this is behavior anyone was counting on, and so isn't really a breaking
change. I don't think it's necessary to include this in the release
notes at all, but I'll add a summary anyway and leave it to your
discretion.

[nushell#15888](nushell#15888) gave custom and
external completers the ability to provide a span for each suggestion to
choose which part of the typed text would be replaced. However, these
spans were treated as being relative to the entire buffer, causing
problems if the command call being completed were a subexpression. With
this release, they will be treated as relative to just the expression
passed to the completer.

## Tasks after submitting

- [ ] Update the
[documentation](https://www.nushell.sh/book/custom_completions.html) to
talk about custom spans
<!--
Thank you for improving Nushell!
Please, read our contributing guide:
https://github.com/nushell/nushell/blob/main/CONTRIBUTING.md
-->

## Release notes summary - What our users need to know
<!--
This section will be included as part of our release notes. See the
contributing guide for more details.
Please include only details relevant for users here. Motivation and
technical details can be added above or below this section.

You may leave this section blank until your PR is finalized. Ask a core
team member if you need help filling this section.
-->

match statements will now work with multiple arms _and_ a guard
expression.

Updated parse_match_block_expression such that in `match 3 {1 | 2 | 3
if true => 'test'}` the logic will now add "if true" guard to "1 | 2 |
3" match pattern and evaluate per existing logic. Previously the guard
check would be skipped for multi-arm expressions, which would always
lead to a parse error (logic expecting "=>")

fixes nushell#16131 

## Tasks after submitting
<!-- Remove any tasks which aren't relevant for your PR, or add your own
-->
- [ ] Update the
[documentation](https://github.com/nushell/nushell.github.io)

---------

Co-authored-by: zc he <blindfs19@gmail.com>
- Variables and environment changes now persist across MCP tool calls
- Removed moka caching dependency (incompatible with stateful evaluation)
- Added tests for variable and env persistence
- Updated tool description to document REPL behavior

This enables workflows like:
  $env.MY_VAR = "hello"  # First call
  $env.MY_VAR             # Second call returns "hello"
This pr addresses issue from comment:
nushell#16760 (comment)

After reviewing the ir for `try`, the problem was found to be in the
`drain-if-end` instruction, which doesn't check exit code of pipeline
data.

## Release notes summary - What our users need to know
### Pipefail works with `try` block
```
> nu --experimental-options=[pipefail]
> try {
  ^false | lines
} catch {|e|
  print $e.exit_code
}
```
It will prints an empty list with additional `1`, because the command is
failed actually.

## Tasks after submitting
NaN
…n running nu scripts or commands. (nushell#17103)

Fixes: nushell#14745

## Release notes summary - What our users need to know
If user runs script or command with a bad config file, the script or
command won't run.
```
echo 'errnocmd' | save config.nu
nu --config config.nu -c 'echo $env.NU_VERSION'
```

won't show nushell version and exits with status code 1.
…7120)

## Summary

- Move evaluate tool description to `evaluate_tool.md`
- Move server instructions to `instructions.md`
- Use `include_str!` instead of inline strings for better
maintainability
- Add NUON format note (no need for `| to json`)
- Add HTTP request examples (`bytes build`, `--content-type`)
- Add `2>&1 -> o+e>` redirect syntax to bash equivalents table
Updating nixpkgs

Latest devshell variant can be used with either:

* using nix directly: `nix develop ./scripts/nix#latest`
* using direnv: `"use flake ./scripts/nix#latest" | save -f .envrc`

---

Probably something that I should make a PR for whenever a release is
coming up.

## Release notes summary - What our users need to know

## Tasks after submitting
- [ ] Update the
[documentation](https://github.com/nushell/nushell.github.io)
## Release notes summary - What our users need to know

`into list` from `std-rfc/conversions` now handles `record` types.

```nushell
use std-rfc/conversions *
{ a: 3, b: 7, c: 10 } | into list
# => ╭───┬─────┬───────╮
# => │ # │ key │ value │
# => ├───┼─────┼───────┤
# => │ 0 │ a   │     3 │
# => │ 1 │ b   │     7 │
# => │ 2 │ c   │    10 │
# => ╰───┴─────┴───────╯
```
andrewgazelka pushed a commit that referenced this pull request Jan 23, 2026
## User-facing Changes

* New arguments! (`error make "hello"`)
* New parts for `error_struct`! (`error make {inner: [] labels: []
...}`)
* Pipeline inputs for chained errors! (`try {error make foo} catch
{error make bar}`)
* Pipeline inputs for normal errors! (`"help" | error make`)
* External errors! (`error make {src: {path: $nu.cofig-path} ...}`)
* Backwards compatibility!

### Arguments and Inputs

The main changes are in how the arguments are passed. Everything is
still backwards compatible with the old `error make` commands, there's
just a nice extra layer we get from the pipeline and a few new args
(that were already added in nushell#17037). There are some new ways to
(hopefully intentionally) cause an error, such as using a naked `error
make`, pipelines from records and simple string input!

#### Inputs

Because `error make` will just make an error anyway, it can technically
take any input to make an error, but only properly formatted record
input will create a chain. the `x | f $in` pattern can be used for
string input, if that is more comfortable.

#### With no arguments

This is a completely new way to do this, with no arguments the `error
make` invocation is highlighted, along with a simple `originates from
here` message. This makes normal errors very easy to create without any
special message setup.

```
> error make
Error: nu::shell::error

  × originates from here
   ╭─[entry nushell#4:1:1]
 1 │ error make
   · ──────────
   ╰────
```

#### Create a single argument

* With pipeline input: `{msg: foo} | error make`
* With an argument: `error make {msg: foo}`
* With a string argument: `error make foo`
```
Error: nu:🐚:error

  × foo
   ╭─[entry nushell#2:1:12]
 1 │ error make {msg: foo}
   ·            ──────────
   ╰────
```
#### Chaining errors together

These will automatically create a chain of errors, placing the pipeline
as an `inner` to the argument. This can very easily be used to get a bit
more detail in a try loop using the naked `error make`:

```
Error: nu:🐚:error

  × originates from here
   ╭─[source:1:31]
 1 │ try {error make "foo"} catch {error make}
   ·                               ──────────
   ╰────

Error: nu:🐚:error

  × foo
   ╭─[source:1:6]
 1 │ try {error make "foo"} catch {error make}
   ·      ──────────
   ╰────
```

Or with more complex errors:

* With both, combining the errors: `{msg: foo} | error make bar`
* With the raw error from try: `try {error make foo} catch {error make
bar}`

Both are equivalent to:
* `error make {msg: bar inner: [{msg: foo}]}`

```
Error: nu:🐚:error

  × bar
   ╭─[entry #1:1:29]
 1 │ try {error make foo} catch {error make bar}
   ·                             ──────────
   ╰────

Error: nu:🐚:error

  × foo
   ╭─[entry #1:1:6]
 1 │ try {error make foo} catch {error make bar}
   ·      ──────────
   ╰────
```

### Labels

As is noticeable in the examples above, simple errors no longer use an
extra line for the label. If no label is present, `error make` will
place a bar under the span of itself or the argument to `error make`.
Labels have also gotten a bit of a rewrite, but they're pretty much the
same as those in nushell#17037, except for `label`, which is now only a single
label (not `oneof<list, label>`).
#### Simple Labels

`label.text` and `labels.*.text` is no longer required for a span to
show up, an empty text will simply underline. This example can either
use `label: $record` or be written as `labels: [$record]`:

```
> def f [x] {
  error make {msg: here label: {span: (metadata $x).span}}
}
f abcd
Error: nu::shell::error

  × here
   ╭─[entry nushell#7:4:3]
 3 │ }
 4 │ f abcd
   ·   ────
   ╰────
```

#### Multiple labels
Any number of labels can be added in the `labels` column, allowing for
more detailed error messages, especially for functions:

```
> def f [x y z] {
  error make {msg: here labels: [
    {text: "there" span: (metadata $x).span}
    {text: "everywhere" span: (metadata $y).span}
    {text: "somewhere" span: (metadata $z).span}
  ]
  }
}
f abcd [x y z] {d: a}

Error: nu:🐚:error

  × here
   ╭─[entry nushell#11:9:3]
 8 │ }
 9 │ f abcd [x y z] {d: a}
   ·   ──┬─ ───┬─── ───┬──
   ·     │     │       ╰── somewhere
   ·     │     ╰── everywhere
   ·     ╰── there
   ╰────
```

#### External sources

There is a `ShellError::OutsideSpannedLabeledError` that can be used to
refer to external sources, not just the internal nushell spanns. This
has been expanded to allow the multi-label stuff to work using the new
`src` column:

```
> "foo\nbar\nbaz" | save -f /tmp/foo.bar
error make {
  msg: 'error here'
  src: {path: /tmp/foo.bar}
  labels: [
    {text: "this" span: {start: 4 end: 7}}
  ]
}
Error: nu:🐚:outside

  × error here
   ╭─[/tmp/foo.bar:2:1]
 1 │ foo
 2 │ bar
   · ─┬─
   ·  ╰── this
 3 │ baz
   ╰────
```

### Errors That Can't be Caught

These will not work since `try` will never get parsed:

- `try {1 + ""} catch {error make badmath}`
- (TODO: Add more examples)

## Internal Changes

Most of the parsing from an error record to an actual error is now moved
into `nu-protocol`, using `FromValue` to turn it into a useful internal
type.

### `nu-protocol::LabeledError`

This struct has a few changes, the main one being the type of
`LabeledError.inner`. It is now a `ShellError`, not another
`LabeledError`. It should be trivial to do a `.into()` for things that
already use `LabeledError.with_inner(x)`.

### `nu-protocol::ShellError::into_value`

I renamed the old `into_value` to `into_full_value` to better say what
it is, since it doesn't just do the `IntoValue::into_value` method, it
also requires some context to create the `Value`. Now `ShellError` has
an `IntoValue` implementation matching other types.

### `nu-protocol::ShellError::{OutsideSource, OutsideSourceNoUrl}`

Miette's derived types don't have a nice way to maybe include a url, so
there are now two types! These allow using multiple labels on outside
sources. They are used internally for the new `{src: {}}` part of the
`error_struct`, and they look a lot more like the `LabeledError`, but
without the need for a separate type and all the fun `impl`s that would
require for the `Diagnostic::source_code` method.

### Misc

* Spelling fix: `into_chainned` => `into_chained`

## Current bugs:
- [x] `OutsideSpannedLabeledError`  
The inner most error of `try {']' from nuon} catch {error make}` will
reference `span: {start: 0, end: 1}`, which in `']' from nuon` will
point to the `]` character, but when it does this in `error make` as an
input it will point to the very first character (probably the `n` in
`nu`).

## Release notes summary - What our users need to know

### New `error make` functionality!
* New arguments! (`error make "hello"`)
* New parts for `error_struct`! (`error make {inner: [] labels: []
...}`)
* Pipeline inputs for chained errors! (`try {error make foo} catch
{error make bar}`)
* Pipeline inputs for normal errors! (`"help" | error make`)
* External errors! (`error make {src: {path: $nu.cofig-path} ...}`)
* Backwards compatibility!


## Tasks after submitting
<!-- Remove any tasks which aren't relevant for your PR, or add your own
-->
- [ ] Update the
[documentation](https://github.com/nushell/nushell.github.io)
andrewgazelka pushed a commit that referenced this pull request Jan 23, 2026
…commands. (nushell#17245)

Fixes: nushell#14862
This issue is happened when creating Iterator from `List/Range` value,
the signal is set to `Signals::empty`, which is unwanted behavior
because `Singal::empty` can'e be interruped.

To fix it, we need to make `List/Range` carries a signal from
`engine_state.signals`. I did this by:
1. introducing `signals` fields to `Value::List/Value::Range`
2. before running a command, manually `inject_signals` to the value.

To be honest the implementation is not really good, not sure if there is
a better way to do this :-(

## Release notes summary - What our users need to know
### Infinite sequences cant be terminated when piped to other command
```
> `1..inf | to md`  # then press ctrl-c
^CError: nu::shell::error

  × Operation interrupted
   ╭─[entry #1:1:1]
 1 │ 1..inf | to md
   · ───────┬──────
   ·        ╰── This operation was interrupted
   ╰────
```
andrewgazelka pushed a commit that referenced this pull request Mar 23, 2026
This PR is a follow-on of these PRs to hopefully finish the last fixing of the sqlite pushdown. The biggest part of this fix is creating mini-sqlite-column-projection code for when sqlite column names are aliased in rust code like `command_line as command`. It's not a fully sql parser but it looks for column aliasing so it knows how to select the data properly. I've tried to comment the code verbosely to help us all remember what it's doing.

- nushell#17415
- nushell#17645
- nushell#17680
- nushell#17668

I also took the opportunity to refactor the push down calls from filter commands so that they're easier to understand by calling a new pipeline function that does the same thing but in a little cleaner way.

There's also a bunch of new tests around `open some_sqlite_file.db`.

Before this PR you would get this with `history | select command`
because `command` is an alias to `command_line`.
```nushell
❯ history | select command
Error: nu::shell::error

  × Failed to execute query
   ╭─[repl_entry #1:1:11]
 1 │ history | select command
   ·           ───┬──
   ·              ╰── no such column: command in SELECT command FROM [history] at offset 7
   ╰────
```
After, it just works (tm)

## Release notes summary - What our users need to know

Refactor sqlite push down and apply to (nearly) all filter commands.

## Tasks after submitting

N/A
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.