Skip to content

Add warning when using history isolation with non-SQLite history format#16151

Merged
Bahex merged 4 commits intonushell:mainfrom
132ikl:isolation-warn
Jul 15, 2025
Merged

Add warning when using history isolation with non-SQLite history format#16151
Bahex merged 4 commits intonushell:mainfrom
132ikl:isolation-warn

Conversation

@132ikl
Copy link
Copy Markdown
Member

@132ikl 132ikl commented Jul 10, 2025

Description

This PR depends on #16147, use git diff 132ikl/shell-warning 132ikl/isolation-warn to see only changes from this PR

People seem to get tripped up by this a lot, and it's not exactly intuitive, so I added a warning if you try to set $env.config.history.isolation = true when using the plaintext file format:

image

User-Facing Changes

  • Added a warning when using history isolation without using SQLite history.

Tests + Formatting

Added a test

After Submitting

N/A

@github-actions
Copy link
Copy Markdown

Hey, just a bot checking in! You edited files related to the configuration.
If you changed any of the default values or added a new config option, don't forget to update the doc_config.nu which documents the options for our users including the defaults provided by the Rust implementation.
If you didn't make a change here, you can just ignore me.

Copy link
Copy Markdown
Member

@sholderbach sholderbach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good observation about the often raised confusion and good exercise of your reworked warning system.
At the same time with our fault recovering config system, should this be a warning or simply a hard error?

@132ikl
Copy link
Copy Markdown
Member Author

132ikl commented Jul 10, 2025

I think it's reasonable for this to be warning because

  1. it doesn't really fully invalid, it's just not what you might expect it to do
  2. people probably already have this in their config and especially if they're using a more monotholic style config it's going to cause breakage which will reasonably upset people

@sholderbach sholderbach added the A:configuration Issue related to nu's configuration label Jul 10, 2025
@Bahex Bahex merged commit c4e8e04 into nushell:main Jul 15, 2025
17 checks passed
@github-actions github-actions bot added this to the v0.106.0 milestone Jul 15, 2025
hardfau1t pushed a commit to hardfau1t/nushell that referenced this pull request Aug 25, 2025
…at (nushell#16151)

# Description
This PR depends on nushell#16147, use `git diff 132ikl/shell-warning
132ikl/isolation-warn` to see only changes from this PR

People seem to get tripped up by this a lot, and it's not exactly
intuitive, so I added a warning if you try to set
`$env.config.history.isolation = true` when using the plaintext file
format:

    Warning: nu::shell::invalid_config

      ⚠ Encountered 1 warnings(s) when updating config

    Warning: nu::shell::incompatible_options

      ⚠ Incompatible options
       ╭─[source:1:33]
     1 │ $env.config.history.isolation = true
       ·                                 ──┬─
       ·                                   ╰── history isolation only compatible with SQLite format
       ╰────
      help: disable history isolation, or set $env.config.history.file_format = "sqlite"


# User-Facing Changes
* Added a warning when using history isolation without using SQLite
history.

# Tests + Formatting
Added a test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A:configuration Issue related to nu's configuration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants