mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-03-27 14:45:13 +08:00
Only print fish_greeting for interactive shells
Shell scripts that use `read` should not trigger fish_greeting. Fixes #1401.
This commit is contained in:
parent
4573a4d69c
commit
e1f623f548
@ -149,20 +149,22 @@ function __fish_config_interactive -d "Initializations that should be performed
|
|||||||
eval "$__fish_bin_dir/fish -c 'fish_update_completions > /dev/null ^/dev/null' &"
|
eval "$__fish_bin_dir/fish -c 'fish_update_completions > /dev/null ^/dev/null' &"
|
||||||
end
|
end
|
||||||
|
|
||||||
#
|
if status -i
|
||||||
# Print a greeting
|
#
|
||||||
#
|
# Print a greeting
|
||||||
|
#
|
||||||
|
|
||||||
if functions -q fish_greeting
|
if functions -q fish_greeting
|
||||||
fish_greeting
|
fish_greeting
|
||||||
else
|
else
|
||||||
if set -q fish_greeting
|
if set -q fish_greeting
|
||||||
switch "$fish_greeting"
|
switch "$fish_greeting"
|
||||||
case ''
|
case ''
|
||||||
# If variable is empty, don't print anything, saves us a fork
|
# If variable is empty, don't print anything, saves us a fork
|
||||||
|
|
||||||
case '*'
|
case '*'
|
||||||
echo $fish_greeting
|
echo $fish_greeting
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user