diff --git a/share/functions/__fish_config_interactive.fish b/share/functions/__fish_config_interactive.fish index 7688ef9c5..6e100fdc1 100644 --- a/share/functions/__fish_config_interactive.fish +++ b/share/functions/__fish_config_interactive.fish @@ -83,7 +83,11 @@ function __fish_config_interactive -d "Initializations that should be performed set -U fish_greeting $line1\n$line2 end - if test "$fish_greeting" + switch $fish_greeting + case '' + # If variable is empty, don't print anything, saves us a fork + + case '*' echo $fish_greeting end diff --git a/share/functions/pwd.fish b/share/functions/pwd.fish index 6d1c3f58a..d51fe5c61 100644 --- a/share/functions/pwd.fish +++ b/share/functions/pwd.fish @@ -3,12 +3,16 @@ # Also drop '/private' directories on OS X. # -if test (uname) = Darwin +switch (uname) + + case Darwin function pwd --description "Print working directory" echo $PWD | sed -e 's|/private||' -e "s|^$HOME|~|" end -else + + case '*' function pwd --description "Print working directory" echo $PWD | sed -e "s|^$HOME|~|" end + end \ No newline at end of file