-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Labels
bugSomething that's not working as intendedSomething that's not working as intended
Milestone
Description
Currently fish_greeting
function is defined as:
fish-shell/share/functions/fish_greeting.fish
Lines 1 to 17 in d338c45
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
Metadata
Metadata
Assignees
Labels
bugSomething that's not working as intendedSomething that's not working as intended