From fa74dc977b533b3fa23fb4294ecbe26137c7e837 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Wed, 5 May 2021 18:40:59 +0200 Subject: [PATCH] fish_greeting: show private mode message if $fish_greeting is empty list This was droped because of Cartesian product expansion. Also fix the spurious dot in case the greeting is "". Fixes #7974 --- CHANGELOG.rst | 1 + share/functions/fish_greeting.fish | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) 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)