fork/fish-shell

git clone https://git.julia.blue/fork/fish-shell

Johannes AltmanningerDon't show private mode greeting if greeting is empty list7acd489a0

master
745 B17 linesraw
1function fish_greeting
2    if not set -q fish_greeting
3        set -l line1 (_ 'Welcome to fish, the friendly interactive shell')
4        set -l line2 \n(printf (_ 'Type %shelp%s for instructions on how to use fish') (set_color green) (set_color --reset))
5        set -g fish_greeting "$line1$line2"
6    end
7
8    if set -q fish_private_mode && set -q fish_greeting[1]
9        set -l line (_ "fish is running in private mode, history will not be persisted.")
10        set -g fish_greeting $fish_greeting\n$line
11    end
12
13    # The greeting used to be skipped when fish_greeting was empty (not just undefined)
14    # Keep it that way to not print superfluous newlines on old configuration
15    test -n "$fish_greeting"
16    and echo $fish_greeting
17end