Back to Fish

fish_greeting - display a welcome message in interactive shells¶

docs/docs/4.3/cmds/fish_greeting.html

latest1.2 KB
Original Source

fish_greeting - display a welcome message in interactive shells

Synopsis

fish\_greeting
function fish\_greeting...end

Description

When an interactive fish starts, it executes fish_greeting and displays its output.

The default fish_greeting is a function that prints a variable of the same name ($fish_greeting), so you can also just change that if you just want to change the text.

While you could also just put echo calls into config.fish, fish_greeting takes care of only being used in interactive shells, so it won’t be used e.g. with scp (which executes a shell), which prevents some errors.

Example

To just empty the text, with the default greeting function:

set -U fish\_greeting

or set -g fish_greeting in config.fish.

A simple greeting:

function fish\_greetingecho Hello friend!echo The time is (set\_color yellow)(date +%T)(set\_color normal) and this machine is called $hostnameend