Open neon64 opened 5 years ago
Hello @neon64, thanks for the feedback.
Was you fish_greeting.fish
located in $HOME/.config/fish/functions/fish_greeting.fish
? That's where installer place our fish_greeting.fish
file, its the recommended way to leverage autoload mechanism.
You can either remove $HOME/.config/fish/functions/fish_greeting.fish
and fallback to your setup or copy your setup in it.
I understand your point about responsability but pure
vision is to provide a clean and pure experience of the prompt. So, removing greeting and other presets sounds in line with this.
However, one is free to customize upon it as described above.
Cheers!
Bumping.
Why is pure the plugin that gets to overwrite the fish_greeting.fish
? What if other plugins want to do the same?
You're overwriting it because you want to check for updates, but shouldn't that be up to the user? Most fish users would be happy to update their greeting to add that feature.
Every time I run my fisher
installer, this plugin wipes out my greeting. You're not really leaving much room for other people to customise fish.
Thanks for the feedback, do you think I can automate the addition of the call?
I would definitely consider adding it to the README as an option to add to config.fish
- I personally wouldn't add it. I like to update my plugins manually.
Here's an alternative. Instead of shipping an empty fish_greeting
function, Pure could just set -U fish_greeting ""
after install. This will suppress Fish's default greeting (in line with @edouard-lopez's line of thought) without wiping out an existing user's custom fish_greeting
function. 🤓
Currently, on new session, pure checks for new release and show command to install, as we override the fish_greeting.fish
file.
:warning: Introduce a breaking change in
pure
's behaviour that will require user action.
functions/fish_greeting.fish
Does that sound right, to you?
@edouard-lopez that sounds right to me. You could also follow the pattern of extending the file if it exists, or the config.fish
, or provide instructions to stdout on install as you sometimes see with apt/brew
Suppress Fish's default greeting, as suggested by @jorgebucaran
There are various ways one may accomplish this. I would define an install event handler in conf.d/pure.fish
like so:
function _pure_install --on-event pure_install
set -U fish_greeting ""
end
You could also follow the pattern of extending the file if it exists,
How would you do that programmatically?
provide instructions to stdout on install
That's a good idea!
Just bumped into this again. @edouard-lopez I agree option 2 is cleaner. Would you like to do it or do you want me to have a go? If you point me to the piece of code that does the overwrite I can take a shot.
@jorgebucaran I defined a custom fish_greeting
function in the project. I believe @wjagodfrey own file is being overwritten during install. Emptying fish_greeting
variable won't resolve the issue when people have added a custom fish_greeting
function.
However, we can:
fish_greeting.fish
to _pure_fish_greeting.fish
so it doesn't override user file ;add a post_install
event handler that check the situation so that:
fish_greeting.fish
is missing, use our (i.e. rename _pure_fish_greeting.fish
as fish_greeting.fish
) ;when fish_greeting.fish
already exists, output instruction to add call to _pure_check_for_new_release
:
echo "_pure_check_for_new_release" >> $fish_function_path/fish_greeting.fish
@wjagodfrey I'm open to PR, here are some entry points:
post_install
event handler, you can put it in https://github.com/pure-fish/pure/blob/master/conf.d/_pure_init.fishThe project has a docker container you can use (cf. makefile)
My suggestion is to simply remove fish_greeting.fish
and use the install event exactly as I suggested in https://github.com/pure-fish/pure/issues/175#issuecomment-1264525058. That's all you need to do.
Installing this prompt overrides my own
fish_greeting.fish
file. While I understand its nice to get rid of the default fish greeting, shouldn't that be the responsibility of the user or a separate plugin, and not the responsibility of a prompt?In other words, I feel it should be possible to mix and match prompts and greetings, rather than one controlling the other.
On another note: thanks very much for this prompt - I particularly like how the arrow direction switches with fish's vim mode - that's much more subtle than any mode indicator I had devised!