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

Show private mode message even if $fish_greeting is empty #7974

Closed
kidonng opened this issue May 5, 2021 · 1 comment
Closed

Show private mode message even if $fish_greeting is empty #7974

kidonng opened this issue May 5, 2021 · 1 comment
Labels
bug Something that's not working as intended
Milestone

Comments

@kidonng
Copy link
Contributor

kidonng commented May 5, 2021

Currently fish_greeting function is defined as:

function fish_greeting
if not set -q fish_greeting
set -l line1 (_ 'Welcome to fish, the friendly interactive shell')
set -l line2 \n(printf (_ 'Type %shelp%s for instructions on how to use fish') (set_color green) (set_color normal))
set -g fish_greeting "$line1$line2"
end
if set -q fish_private_mode
set -l line (_ "fish is running in private mode, history will not be persisted.")
set -g fish_greeting $fish_greeting.\n$line
end
# The greeting used to be skipped when fish_greeting was empty (not just undefined)
# Keep it that way to not print superfluous newlines on old configuration
test -n "$fish_greeting"
and echo $fish_greeting
end

When $fish_greeting is empty, the $fish_greeting.\n$line will expand into a empty string, so fish --private won't show any message either.

I wonder if it makes sense to still show the private mode message ("fish is running in private mode, history will not be persisted."), even if $fish_greeting is empty.


Also, there's a slight inconsistency:

$ set -U fish_greeting 
$ fish -P

(no message)

---

$ set -U fish_greeting ""
$ fish -P
.
fish is running in private mode, history will not be persisted.

For reference, there is a similar issue: #6299

@krobelus krobelus added the bug Something that's not working as intended label May 5, 2021
@krobelus krobelus added this to the fish 3.3.0 milestone May 5, 2021
@kidonng
Copy link
Contributor Author

kidonng commented May 6, 2021

Thanks @krobelus!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something that's not working as intended
Projects
None yet
Development

No branches or pull requests

2 participants