2020-05-30 06:53:08 +00:00
|
|
|
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.")
|
2021-05-05 16:40:59 +00:00
|
|
|
if set -q fish_greeting[1]
|
|
|
|
set -g fish_greeting $fish_greeting\n$line
|
|
|
|
else
|
|
|
|
set -g fish_greeting $line
|
|
|
|
end
|
2020-05-30 06:53:08 +00:00
|
|
|
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
|