Skip to content

feature: custom install location support#397

Merged
edouard-lopez merged 8 commits intopure-fish:masterfrom
benedictleejh:feature/custom-install-location-support
Mar 2, 2026
Merged

feature: custom install location support#397
edouard-lopez merged 8 commits intopure-fish:masterfrom
benedictleejh:feature/custom-install-location-support

Conversation

@benedictleejh
Copy link
Contributor

@benedictleejh benedictleejh commented Jan 18, 2026

related: fixes #394

Adds support for installing pure into a custom install location. As suggested in #394, a variable _pure_root is added to _pure_init.fish to determine the install location, and all instances of __fish_config_path is replaced by _pure_root, so the source commands in _pure_init.fish will work correctly regardless of where pure is installed into. This allows pure to work when installed into a custom fisher install location.

How to try this PR?

set --export --universal fisher_path $XDG_DATA_HOME/fisher
fisher install benedictleejh/pure@feature/custom-install-location-support

Acceptance Checks

  • Documentation is up-to-date:
    • Add entry in feature list of [README.md][README] ;
    • Add entry in features' overview in [docs/][features-overview] ;
    • Add section in [feature list][features-list] to document
      • Features' flag ;
      • Prompt symbol ;
  • Default are defined in [conf.d/pure.fish][default] for:
    • Feature flag ;
    • Symbol ;
  • Tests are passing (I can help you 🤗 ):
    • Config are tested (cf. [tests/_pure.test.fish][config-test]) ;
    • Feature is tested in tests/feature_name.test.fish ;
  • Customization is available ;
  • Feature is implemented.

The unchecked items are not relevant to this PR

As the location for `_pure_init.fish` is stored inside a `_pure*` variable, erasing the variable
before deleting files would fail to delete `_pure*` files as the variable no longer exists, and
the files would not be able to be located. As such, we delete the files before erasing the
variables to properly delete them.
Comment on lines +53 to +54
cp $_pure_root/functions/fish_prompt{,.pure-backup}.fish
cp $_pure_root/functions/fish_title{,.pure-backup}.fish
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not too sure this is the right thing to do for these, as backing up into the _pure_root, which might not be the __fish_config_dir, might not be particularly visible to the user. I wonder if making a backup into __fish_config_dir makes sense here, especially if the user already has their own fish_prompt and fish_title

Copy link
Member

Choose a reason for hiding this comment

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

Yep, those lines are useless and do not match the comment. You can remove them

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you, removed in c4b12f6

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The failing tests are due to the removal of these lines. Did I misunderstand and it's my changes in these lines that should be removed?

@benedictleejh
Copy link
Contributor Author

Hi, could I get a review on this PR? Thanks

@edouard-lopez
Copy link
Member

Hello, thanks for your work and patience 🙏.
I was at FOSDEM last week, I will aim to merge this PR by mid-February

@edouard-lopez
Copy link
Member

@benedictleejh Hello, I tested it. Works fine!
Could you add a short section on https://github.com/pure-fish/pure/blob/master/docs/components/troubleshooting.md to mention the support of this?

Copy link
Member

@edouard-lopez edouard-lopez left a comment

Choose a reason for hiding this comment

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

Almost there!

Comment on lines +53 to +54
cp $_pure_root/functions/fish_prompt{,.pure-backup}.fish
cp $_pure_root/functions/fish_title{,.pure-backup}.fish
Copy link
Member

Choose a reason for hiding this comment

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

Yep, those lines are useless and do not match the comment. You can remove them

@benedictleejh
Copy link
Contributor Author

benedictleejh commented Feb 14, 2026

Could you add a short section on https://github.com/pure-fish/pure/blob/master/docs/components/troubleshooting.md to mention the support of this?

I've added a note as suggested in efeba89. If there's anything that should be noted that I've missed, do let me know.

@edouard-lopez edouard-lopez merged commit 4ef497e into pure-fish:master Mar 2, 2026
8 checks passed
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.

Avoid hardcoding $__fish_config_path for fisher related functions

2 participants