diff --git a/CHANGELOG.rst b/CHANGELOG.rst index a1617e961..2076c68b4 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -41,6 +41,7 @@ Interactive improvements - ``funced`` won't include an entry on where a function is defined, thanks to the new ``functions --no-details`` option (:issue:`7879`). - The git prompt now has the same symbol order in normal and "informative" mode, and it's customizable via ``$__fish_git_prompt_status_order`` (:issue:`7926`). - Variable ``fish_killring`` containing entries from killring is now available (:issue:`7445`). +- ``fish --private`` prints a note on private mode on startup even if ``$fish_greeting`` is an empty list (:issue:`7974`). New or improved bindings ^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/share/functions/fish_greeting.fish b/share/functions/fish_greeting.fish index 2735b1c16..a2babf591 100644 --- a/share/functions/fish_greeting.fish +++ b/share/functions/fish_greeting.fish @@ -7,7 +7,11 @@ function fish_greeting 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 + if set -q fish_greeting[1] + set -g fish_greeting $fish_greeting\n$line + else + set -g fish_greeting $line + end end # The greeting used to be skipped when fish_greeting was empty (not just undefined)