1

I wanted to remove Fish shell greetings. As I was searching for the solution, I went to this StackOverflow question saw a technique where I can minimize default welcome script to the new one. And I did this on my terminal:

pranav@exam ~> function fish_greeting
                   StackOverflow
               end
pranav@exam ~> funcsave fish_greeting

This is accepted & highly voted answer. I wonder why it didn't work for me. Because launching the terminal again will show this big mess above the user input:

~/.config/fish/functions/fish_greeting.fish (line 2): 
StackOverflow
^
in function 'fish_greeting'
    called on line 126 of file /usr/share/fish/functions/__fish_config_interactive.fish
in function '__fish_config_interactive'
    called on line 170 of file /usr/share/fish/config.fish
in function '__fish_on_interactive'
in event handler: handler for generic event “fish_prompt”
pranav@exam ~> 

So I wanted to remove it greetings altogether by when I found this command in the FAQ page of Fish:

pranav@exam ~> set fish_greeting

Now, the problem is this doesn't work. I've relaunched the terminal, stopped the GDM, and restart the GDM since I use Wayland display server, tried to logout & login and even restarted my computer but none of them worked. Because I can still see the error message whenever I launch the terminal. I use Ubuntu 20.04 with pranav@exam ~>. If u are the fish shell expert, help the noob student who has just started to use this amazing shell.

Pranav
  • 263
  • 2
  • 11

1 Answers1

4

Your fish_greeting function tries to execute a command named "StackOverflow" that doesn't exist. The original answer suggested using the "fortune" command, which is an actual thing you might have installed.

If you have both a function and a variable named "fish_greeting", the function takes precedence, so the solution is to fix the function. Use a command that exists, or none at all:

function fish_greeting
end

funcsave fish_greeting
faho
  • 14,470
  • 2
  • 37
  • 47