aboutsummaryrefslogtreecommitdiffhomepage
path: root/share/functions/__fish_config_interactive.fish
diff options
context:
space:
mode:
authorGravatar Kevin Ballard <kevin@sb.org>2014-09-21 20:33:58 -0700
committerGravatar Kevin Ballard <kevin@sb.org>2014-09-21 20:35:33 -0700
commite1f623f548c0e6241642db96c522c411cd84d755 (patch)
tree1e540f90a41ea46a42b6e67aef4f997bce139eeb /share/functions/__fish_config_interactive.fish
parent4573a4d69ccdbaa9f5dc51574400c21e40fd15e9 (diff)
Only print fish_greeting for interactive shells
Shell scripts that use `read` should not trigger fish_greeting. Fixes #1401.
Diffstat (limited to 'share/functions/__fish_config_interactive.fish')
-rw-r--r--share/functions/__fish_config_interactive.fish28
1 files changed, 15 insertions, 13 deletions
diff --git a/share/functions/__fish_config_interactive.fish b/share/functions/__fish_config_interactive.fish
index 173c7456..45b2e710 100644
--- a/share/functions/__fish_config_interactive.fish
+++ b/share/functions/__fish_config_interactive.fish
@@ -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' &"
end
- #
- # Print a greeting
- #
-
- if functions -q fish_greeting
- fish_greeting
- else
- if set -q fish_greeting
- switch "$fish_greeting"
- case ''
- # If variable is empty, don't print anything, saves us a fork
+ if status -i
+ #
+ # Print a greeting
+ #
- case '*'
- echo $fish_greeting
+ if functions -q fish_greeting
+ fish_greeting
+ else
+ if set -q fish_greeting
+ switch "$fish_greeting"
+ case ''
+ # If variable is empty, don't print anything, saves us a fork
+
+ case '*'
+ echo $fish_greeting
+ end
end
end
end