Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Suppress or Customize Intro Message in Fish Shell

Tags:

fish

People also ask

How do I customize my fish shell prompt?

The "prompt" tab displays the contents of the current fish shell prompt. It allows selection from 17 predefined prompts. To change the prompt, select one and press "Prompt Set!".

How do you set up a fish shell?

You can make FSH your default shell on the terminal via two simple steps: Add the line /usr/local/bin/fish to the /etc/shells file (it may already be there depending on how you have installed the shell). This is assuming FSH was installed in /usr/local/bin, as is the default location for when it is compiled.


Found that the greeting message is set in fishd.Machine.local. To override the following to ~/.config/fish/config.fish:

set fish_greeting

Kevin's answer works fine for static text. If you need an interactive welcome message, such as mine involving the fortune command, you can do

function fish_greeting

Create your fish_greeting function. I just have

function fish_greeting
    fortune
end

and save it with

funcsave fish_greeting

Warning: No longer works since fish 2.4.0—see Kevin's answer for the correct contemporary solution.

If there is no environment variable named "fish_greeting", then nothing will be printed. By default, there is a fish_greeting variable. You can erase this:

set --erase fish_greeting

> set --universal fish_greeting