Only set various startup defaults once. Even if the user removes them, do not try to reset them.

darcs-hash:20080108161856-75c98-7d228f7a0c62aa8be74f66ce72d0cadbc3030f5d.gz
This commit is contained in:
liljencrantz 2008-01-09 02:18:56 +10:00
parent 286ce1d6a4
commit da4a4bcc18

View file

@ -74,12 +74,9 @@ function __fish_config_interactive -d "Initializations that should be performed
end
#
# Print a greeting
# If we are starting up for the first time, set various defaults
#
#
# If we are starting up for the first time, set the default greeting
#
if not set -q __fish_init_1_23_0
if not set -q fish_greeting
set -l line1 (printf (_ 'Welcome to fish, the friendly interactive shell') )
@ -87,23 +84,6 @@ function __fish_config_interactive -d "Initializations that should be performed
set -U fish_greeting $line1\n$line2
end
set -U __fish_init_1_23_0
end
switch $fish_greeting
case ''
# If variable is empty, don't print anything, saves us a fork
case '*'
echo $fish_greeting
end
#
# Set exit message
#
function fish_on_exit --description "Commands to execute when fish exits" --on-process %self
printf (_ "Good bye\n")
end
#
# Set various defaults using these throwaway functions
@ -160,6 +140,28 @@ function __fish_config_interactive -d "Initializations that should be performed
functions -e set_default
end
#
# Print a greeting
#
switch $fish_greeting
case ''
# If variable is empty, don't print anything, saves us a fork
case '*'
echo $fish_greeting
end
#
# Set exit message
#
function fish_on_exit --description "Commands to execute when fish exits" --on-process %self
printf (_ "Good bye\n")
end
#
# This event handler makes sure the prompt is repainted when
# fish_color_cwd changes value. Like all event handlers, it can't be