diff --git a/doc_src/doc.hdr b/doc_src/doc.hdr index 5bcca19d7..3ccba1907 100644 --- a/doc_src/doc.hdr +++ b/doc_src/doc.hdr @@ -777,6 +777,7 @@ certain environment variables. - \c BROWSER, which is the users preferred web browser. If this variable is set, fish will use the specified browser instead of the system default browser to display the fish documentation. - \c CDPATH, which is an array of directories in which to search for the new directory for the \c cd builtin. - A large number of variable starting with the prefixes \c fish_color and \c fish_pager_color. See Variables for changing highlighting colors for more information. +- \c fish_greeting, which is the greeting message printed on startup. - \c LANG, \c LC_ALL, \c LC_COLLATE, \c LC_CTYPE, \c LC_MESSAGES, \c LC_MONETARY, \c LC_NUMERIC and \c LC_TIME set the language option for the shell and subprograms. See the section Locale variables for more information. - \c PATH, which is an array of directories in which to search for commands - \c umask, which is the current file creation mask. The preferred way to change the umask variable is through the umask shellscript function. An attempt to set umask to an invalid value will always fail. @@ -2490,6 +2491,7 @@ DAMAGES. - The open command doesn't work. - How do I make fish my default shell? - I'm seeing weird output before each prompt when using screen. What's wrong? +- How do I change the greeting message?
+set fish_greeting ++ + */ diff --git a/etc/fish_interactive.fish.in b/etc/fish_interactive.fish.in index 0e5d55432..4e96daba6 100644 --- a/etc/fish_interactive.fish.in +++ b/etc/fish_interactive.fish.in @@ -7,13 +7,6 @@ if not status --is-interactive exit end -# -# Print a greeting -# - -printf (_ 'Welcome to fish, the friendly interactive shell\n') -printf (_ 'Type %shelp%s for instructions on how to use fish\n') (set_color green) (set_color normal) - # # Set exit message # diff --git a/share/fish.in b/share/fish.in index b1d88b784..8b1feeadf 100644 --- a/share/fish.in +++ b/share/fish.in @@ -18,7 +18,6 @@ if not set -q fish_complete_path set -U fish_complete_path ~/.fish.d/completions @sysconfdir@/fish.d/completions @datadir@/fish/completions end - set __fish_help_dir @docdir@ # This is a Solaris-specific test to modify the PATH so that @@ -74,6 +73,19 @@ for i in (printf "%s\n" $path_list|grep -E -v $path_regexp) end end +# +# Print a greeting +# + +if not set -q fish_greeting + set -l line1 (printf (_ 'Welcome to fish, the friendly interactive shell') ) + set -l line2 (printf (_ 'Type %shelp%s for instructions on how to use fish') (set_color green) (set_color normal)) + set -U fish_greeting $line1\n$line2 +end + +echo $fish_greeting + + # # Don't need completions in non-interactive mode #