mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 04:43:10 +00:00
Only do fish_greeting if interactive
Even if __fish_config_interactive, it can be shown when a script uses `read`. Fixes #3261, #1401.
This commit is contained in:
parent
e75fc8452f
commit
b77e2a67f8
1 changed files with 9 additions and 7 deletions
|
@ -110,6 +110,7 @@ function __fish_config_interactive -d "Initializations that should be performed
|
||||||
# Print a greeting.
|
# Print a greeting.
|
||||||
# fish_greeting can be a function (preferred) or a variable.
|
# fish_greeting can be a function (preferred) or a variable.
|
||||||
#
|
#
|
||||||
|
if status --is-interactive
|
||||||
if functions -q fish_greeting
|
if functions -q fish_greeting
|
||||||
fish_greeting
|
fish_greeting
|
||||||
else
|
else
|
||||||
|
@ -118,6 +119,7 @@ function __fish_config_interactive -d "Initializations that should be performed
|
||||||
test -n "$fish_greeting"
|
test -n "$fish_greeting"
|
||||||
and echo $fish_greeting
|
and echo $fish_greeting
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
#
|
#
|
||||||
# This event handler makes sure the prompt is repainted when
|
# This event handler makes sure the prompt is repainted when
|
||||||
|
|
Loading…
Reference in a new issue