Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move fish_greeting to a function #7265

Merged
merged 3 commits into from
Aug 21, 2020
Merged

Move fish_greeting to a function #7265

merged 3 commits into from
Aug 21, 2020

Conversation

faho
Copy link
Member

@faho faho commented Aug 18, 2020

This adds a "fish_greeting" function that prints the variable of the
same name.

In doing so, it makes $fish_greeting default to a global
variable (this is of little cost because of the _ builtin)

This means that:

  • We have fewer universal variables by default
  • If we change the default greeting people will actually get
    it (unless they have a leftover universal, of course)
  • If the user changes their language the variable changes with it

TODOs:

  • Changes to fish usage are reflected in user documentation/manpages.
  • [N/A] Tests have been added for regressions fixed
  • User-visible changes noted in CHANGELOG.rst

This adds a "fish_greeting" function that prints the variable of the
same name.

In doing so, it makes $fish_greeting default to a global
variable (this is of little cost because of the `_` builtin)

This means that:

- We have fewer universal variables by default
- If we change the default greeting people will actually get
- it (unless they have a leftover universal, of course)
- If the user changes their language the variable changes with it
@faho faho added this to the fish 3.2.0 milestone Aug 18, 2020
@zanchey
Copy link
Member

zanchey commented Aug 18, 2020

The "it's a function! and a variable!" nature always gives me the heebie-jeebies, but this sounds sensible to me.

@exploide
Copy link
Contributor

When launching a fish for the first time, I usually only need to do two things: First, add the sbin directories to the PATH and second, disable the fish_greeting message. What is the preferred way for doing the latter, now that it is a global variable instead of a universal? Prior to that I just ran set fish_greeting.

@faho
Copy link
Member Author

faho commented Aug 19, 2020

What is the preferred way for doing the latter, now that it is a global variable instead of a universal? Prior to that I just ran set fish_greeting.

It defaults to a global variable. You can still set it as a universal:

set -U fish_greeting

Or set it as a global in config.fish (this is executed after), or customize the function.

@ridiculousfish
Copy link
Member

This LGTM! Don't forget to update CHANGELOG.

@faho faho merged commit c148b6e into fish-shell:master Aug 21, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 19, 2020
@faho faho deleted the greeting branch November 22, 2022 10:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants