229

Is it possible to remove the intro message in fish shell:

Welcome to fish, the friendly interactive shell

Type help for instructions on how to use fish

Community
  • 1
  • 1
Kevin Sylvestre
  • 37,288
  • 33
  • 152
  • 232

10 Answers10

268

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

set fish_greeting
Kevin Sylvestre
  • 37,288
  • 33
  • 152
  • 232
198

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
wjandrea
  • 28,235
  • 9
  • 60
  • 81
workflow
  • 2,536
  • 2
  • 14
  • 11
52

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
Jorge Bucaran
  • 5,588
  • 2
  • 30
  • 48
awelkie
  • 2,422
  • 1
  • 22
  • 32
  • yes, once the variable is deleted it won't be re-created. – awelkie Apr 13 '17 at 20:27
  • 4
    I think this worked once, but it doesn't anymore; now it seems you need to [set the variable to an empty string](http://fishshell.com/docs/current/faq.html#faq-greeting). – mjs Jun 13 '17 at 07:34
16
> set --universal fish_greeting
kzh
  • 19,810
  • 13
  • 73
  • 97
10

Create your fish_greeting function. I just have

function fish_greeting                                             13:23:39
    echo 'Hello'
end 

and save it with

funcsave fish_greeting
khairul abdi
  • 101
  • 2
  • 3
8

Read the official document please.

http://fishshell.com/docs/current/faq.html#faq-greeting

short answer: set -e fish_greeting

Weihang Jian
  • 7,826
  • 4
  • 44
  • 55
8

Add set fish_greeting to your ~/.config/fish/config.fish file.

This is answered in the Fish FAQ:

How do I run a command every login? What's fish's equivalent to .bashrc?

Edit the file ~/.config/fish/config.fish, creating it if it does not exist (Note the leading period).

How do I change the greeting message?

Change the value of the variable fish_greeting or create a fish_greeting function. For example, to remove the greeting use:

set fish_greeting
Community
  • 1
  • 1
Chris Martin
  • 30,334
  • 10
  • 78
  • 137
6

This is a kind of silly answer. You can create a fish_greeting.fish empty file in ~/.config/fish/functions folder and this will remove the greeting message.

That can be done by

$ touch ~/.config/fish/functions/fish_greeting.fish

Or

$ function fish_greeting.fish
end

$ funcsave fish_greeting.fish
5

Change the value of the variable fish_greeting or create a fish_greeting function. For example, to remove the greeting use:

set -U fish_greeting

Or if you prefer not to use a universal variable, use:

set -g fish_greeting

Make sure to add space after fish_greeting if you need to disable the greeting

MUADH
  • 51
  • 1
  • 2
3

You could also display random pokemon as fish greeting after installing this script here. Open your terminal and type in:

function fish_greeting
    $HOME/.pokemon-icat/pokemon-icat.sh
end

And save the function for future fish greetings

funcsave fish_greeting

I just love it to open a terminal and the first thing that pops up is a pokemon. Even more satisfying if its a legend one :)

starryn1ght
  • 113
  • 4