avatarpachoyan

Summary

The website content provides instructions on how to disable or customize the greeting message in the Fish Shell, a user-friendly command-line shell.

Abstract

The article discusses the Fish Shell and the methods to disable or customize its greeting message. The author shares their personal experience transitioning from Zsh to Fish Shell, highlighting the initial challenges and the overall positive experience. The greeting message, which the author initially ignored, became an annoyance when using the fzf.vim plugin in Vim, prompting the search for a solution. The article outlines three main methods to remove the greeting message: overwriting the fish_greeting function in the config.fish file, erasing the fish_greeting variable from the shell, and creating a new function in ~/.config/fish/functions to replace the default greeting. Additionally, the author mentions the possibility of customizing the greeting message by modifying the function to display a preferred message instead.

Opinions

  • The author expresses satisfaction with the Fish Shell after overcoming initial compatibility issues and configuration challenges.
  • The greeting message was not bothersome until it interfered with the fzf.vim plugin in Vim, which motivated the author to seek a solution.
  • The article conveys a preference for a clean and unobtrusive terminal experience, advocating for the removal or customization of the greeting message to enhance usability.
  • The author endorses an AI service, ZAI.chat, as a cost-effective alternative to ChatGPT Plus (GPT-4), suggesting it as a recommendation for readers who found the article helpful.

How to disable Fish Shell “Greeting Message”

I started using fish years ago after being tired of having to configure everything in zsh, and to have a fresh start on something new that seemed exciting.

After a tough start, and deal with issues like bash compatibility unlike zsh, or tools not having specific instructions to make it work with fish, I can say I have had a great time using it.

fish shell logo

Something I have never noticed, or it never bother me, was the greeting message displayed when opening a terminal with fish.

This was always something I have maybe ignored by running ctrl-L every time or I got used to it.

Welcome to fish, the friendly interactive shell
Type help for instructions on how to use fis

> ~ 

But stories not always have a good ending. After I started using vim I did noticed something unpleasant was happening when using fzf.vim.

The greeting message was being shown on the search pane when looking for files. This started annoying me. It was a transient thing, it never happened again, but that day I did look into a solution in order to get rid of this message.

As in many other tools, there are several ways of disabling this message.

Overwrite fish_greeting on config.fish

The easiest way is to adding this line into you ~/.config/fish/config.fish file, overwriting the current message:

set fish_greeting

Erase fish_greeting on the terminal

Another way can be by erasing the variable from the fish shell:

set --erase fish_greeting

Creating a function to replace the actual fish_greeting

And the one that requires most work would be by creating a function on ~/.config/fish/functions named fish_greeting.fish:

function fish_greeting                                            
    # do nothing
end 

As an extra, if you want to change the message, you can by printing out a message within the function:

function fish_greeting                                            
    echo 'Hello!'
end

Summary

We have seen different ways of disabling the fish greeting message by:

  • Overwriting the function directly on config.fish.
  • Erasing the function directly from the terminal.
  • Overwriting the function by adding a new one with the same one on the functions folder.

Finally we have seen it is possible to tweak the greeting message if we want to.

Fishshell
Linux
Terminal
Shell
Recommended from ReadMedium