Skip to content

Turn on native-clip and cell-path-types by default - #19634

Merged
fdncred merged 1 commit into
nushell:mainfrom
fdncred:promote_experimental_options
Nov 23, 2026
Merged

fdncred merged 1 commit into
nushell:mainfrom
fdncred:promote_experimental_options

Conversation

@fdncred

@fdncred fdncred commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Description

This PR changes two experimental options from opt-in to opt-out, so they're on by default. Both have been opt-in for more than three months.

dc-glob is old enough too, but it stays opt-in for now.

Since both options are now on for everyone, this PR also fixes three bugs that were reachable only with an option turned on:

  • cell-path-types typed an optional path like $list.5? as the element type, int, so let x: nothing = $list.5? failed to parse. Now a path with any ? member is typed oneof<int, nothing>.
  • On Linux, clip copy always used the background clipboard thread, because $env.config.clip.resident_mode = false was ignored. The setting now works, and the old plugins.clip.NO_RESIDENT key still overrides it when set.
  • If the OS refused to start that thread, clip copy panicked. Now it returns an error.

User-facing changes (Release notes)

  • The native-clip experimental option is now on by default. clip copy and clip paste are built-in commands that use the system clipboard directly. use std/clip still adds the OSC 52 commands clip copy52 and clip paste52.
  • This breaks "text" | clip on Windows, which used to run clip.exe. Now clip is the built-in command and that line fails to parse. Use clip copy, or ^clip to run clip.exe.
  • The cell-path-types experimental option is now on by default. Nushell infers the type of cell paths such as $record.field while parsing, so assigning one to a variable of the wrong type fails before the script runs. Before, the error appeared only when the line ran.
  • On Linux, $env.config.clip.resident_mode = false now turns off the background clipboard thread.
  • To get the old behavior, turn either option off with nu --experimental-options '[native-clip=false, cell-path-types=false]', or set NU_EXPERIMENTAL_OPTIONS=native-clip=false,cell-path-types=false for sessions that load your config.

Additional notes

Both experimental options have been opt-in for more than three months, so
they become opt-out. dc-glob stays opt-in.

This also fixes bugs that were reachable only with an option turned on:

- cell-path-types typed `$list.5?` as the element type, so
  `let x: nothing = $list.5?` failed to parse. A path with a `?` member is
  now typed `oneof<T, nothing>`.
- On Linux, `clip copy` ignored `$env.config.clip.resident_mode = false`.
  The legacy `plugins.clip.NO_RESIDENT` key now overrides the setting only
  when it is set.
- If the clipboard holder thread fails to start, `clip copy` returns an
  error instead of panicking.

Tests: the mut_ tests pin CELL_PATH_TYPES, the clip completion test is no
longer ignored, and there are new parser tests for optional cell paths and
unit tests for the resident-mode setting.
@github-actions github-actions Bot added the A:parser Issues related to parsing label Nov 22, 2026
@fdncred
fdncred merged commit 7e1fe77 into nushell:main Nov 23, 2026
15 checks passed
@fdncred
fdncred deleted the promote_experimental_options branch November 23, 2026 14:26
@github-actions github-actions Bot added this to the v0.118.0 milestone Nov 23, 2026
@fdncred fdncred added notes:ready Indicates Ready for Release notes notes:other Noted in "Other changes" section labels Nov 23, 2026
fdncred added a commit that referenced this pull request Nov 23, 2026
#19645)

## Description

`repl::test_engine::const_switch_rejects_a_value_that_is_not_a_bool`
fails on main (1dc849d), and so does every PR's root test job. #19638
added the test. Two PRs merged a few minutes before it changed what the
test expects, and each of the three passed CI on its own base:

- #19634 turned on `cell-path-types`, so the parser now knows `$r.a` in
`const r = {a: 5}` is an `int`. It rejects `--chars=$r.a` with a type
mismatch and never evaluates the const.
- #19635 moved errors from parse-time evaluation out of
`ParseError::LabeledError` and into the new `ParseError::ParseTimeEval`.

The test covers the check #19638 added to const evaluation, so it needs
an argument the parser can't type. It now passes `($r | get a)`. `get`
returns `any`, so the parser lets it through and the const evaluation
rejects it. The test matches the `CantConvert` inside `ParseTimeEval`,
the same way `builtin_switch_rejects_a_value_that_is_not_a_bool` matches
its error.

## User-facing changes (Release notes)
<!--
This section is used (mostly as-is) for https://www.nushell.sh/blog/

Describe how Nushell behavior changes from a user's perspective.
Do NOT describe internal Rust changes here.

Write in a release note style, for example:
- "Added support for..."
- "Fixed an issue where..."
- "Nushell now supports..."
- "Improved performance of..."

If your changes do NOT affect users (internal refactors, cleanup, etc.),
just write:
- "n/a"
- "nan"
- or similar

This tells us the change should not appear in the changelog.

Tips:
- Focus on observable behavior
- Include examples if helpful
- Keep it concise

You can:
- Write a short paragraph (will appear as a bullet point), OR
- Use headings (###) if your change needs more structure

Avoid writing things like:
- "In this PR, I refactored..."
- "This updates internal code..."

You may leave this blank until the PR is ready.
-->

## Additional notes
<!--
Optional.

Examples:
- fixes #123
- closes #456
- related #789

Anything else reviewers should know.
Remove this section if not needed.
-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A:parser Issues related to parsing notes:other Noted in "Other changes" section notes:ready Indicates Ready for Release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant