fish: don't enable private mode when --no-config is set - #12741
Open
ChrisJr404 wants to merge 1 commit into
Open
fish: don't enable private mode when --no-config is set#12741ChrisJr404 wants to merge 1 commit into
ChrisJr404 wants to merge 1 commit into
Conversation
`--no-config` skips reading user/system config files. Until now it also flipped on private mode, which blocks history reads/writes and breaks `history merge`. The documented purpose of `--no-config` is only to skip configuration; users who want a no-history session already have `--private`. Stop setting `enable_private_mode` from the `-N` branch. `--private` still enables private mode on its own, and combining both flags still gives a private no-config shell. Closes fish-shell#12711 Signed-off-by: ChrisJr404 <chris@hacknow.com>
krobelus
self-requested a review
May 17, 2026 14:17
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #12711.
fish --no-config -c 'set -g fish_history fish; history merge'errors withhistory: can't merge history in private mode. The reporter expects--no-configto skip default config dirs without touching history behaviour;--privatealready covers the no-history case.The cause is in
src/bin/fish.rs. The-N/--no-configarm sets bothopts.no_configandopts.enable_private_mode:The documented behaviour of
--no-config(doc_src/cmds/fish.rst) is just "Do not read configuration files." There is no docs note that says--no-configshould imply private mode, and--privateis the documented way to opt into "fish will not access old or store new history."The patch drops the implicit
enable_private_mode = true.--privatestill triggers private mode on its own, and--no-config --privatetogether still produce a private no-config shell.Verification
Before:
After:
Tests
Extended
tests/checks/no-config.fishto assertfish_private_modeis unset under--no-configand thathistory mergesucceeds.Full local run:
python3 tests/test_driver.py target/release-> 242 / 242 passed (6 skipped).Changelog
Added a bullet under the unreleased section in
CHANGELOG.rst.