From e11677ef6631db175d19296bdd8c472be5c17a4b Mon Sep 17 00:00:00 2001 From: axel Date: Tue, 10 Oct 2006 07:49:05 +1000 Subject: Make the greeting message configurable using the fish_greeting variable darcs-hash:20061009214905-ac50b-cc07bf2b76c5306f96d1bca7fd478d972de25de8.gz --- doc_src/doc.hdr | 14 ++++++++++++++ etc/fish_interactive.fish.in | 7 ------- share/fish.in | 14 +++++++++++++- 3 files changed, 27 insertions(+), 8 deletions(-) diff --git a/doc_src/doc.hdr b/doc_src/doc.hdr index 5bcca19d..3ccba190 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?
@@ -2603,4 +2605,16 @@ You may need to adjust the above path to e.g. /usr/local/bin/fish. You will need to log out and back in again for the change to take effect. +
+ +\section faq-greeting How do I change the greeting message? + +Change the value of the variable fish_greeting. For example, to remove +the greeting use: + +
+set fish_greeting
+
+ + */ diff --git a/etc/fish_interactive.fish.in b/etc/fish_interactive.fish.in index 0e5d5543..4e96daba 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 b1d88b78..8b1feead 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 # -- cgit v1.2.3