FISH_PROMPT(1)
πΈ FISH_PROMPT(1) β the fish-shell manual, bestie edition πΈ
okay so you're here because you wanna know about fish_prompt, and honestly? iconic choice. this is the fish-shell man page, and we're gonna get you all the way together. π
β¨ NAME β¨
fish_prompt β defines the appearance of the command line prompt π
β¨ SYNOPSIS β¨
function fish_prompt
...
end
β¨ DESCRIPTION β¨
so the tea is: the fish_prompt function gets executed whenever the prompt is about to be shown, and whatever it outputs? that is your prompt. literally the whole vibe. β¨
now, important detail, don't skip this β the exit status of commands within fish_prompt will not modify the value of $status outside of the fish_prompt function. so like, you can go feral in there, your $status is safe. no cap. π«Ά
if fish_transient_prompt is set to 1, then fish_prompt --final-rendering is run before executing the commandline. yes, that's a whole extra rendering pass. it's giving final boss energy. π
and if SHELL_PROMPT_PREFIX or SHELL_PROMPT_SUFFIX are set, they get automatically prepended and appended to the left prompt. this applies to all prompts, regardless of whether fish_prompt has been customized. so even if you hand-rolled your own gorgeous prompt, these still show up. iykyk. π
also!! fish ships with a number of example prompts that you can choose with the fish_config command. built-in aesthetics, zero effort, we love to see it. π
β¨ EXAMPLE β¨
a simple prompt, for when you're feeling minimal but still cute:
function fish_prompt -d "Write out the prompt"
# This shows up as USER@HOST /home/user/ >, with the directory colored
# $USER and $hostname are set by fish, so you can just use them
# instead of using `whoami` and `hostname`
printf '%s@%s %s%s%s > ' $USER $hostname \
(set_color $fish_color_cwd) (prompt_pwd) (set_color --reset)
end
like look at that. $USER and $hostname are set by fish so you don't even gotta call whoami and hostname yourself. efficiency queen behavior. π¦
β¨ Copyright β¨
fish-shell developers π
and that's the whole page, bestie β this was the fish_prompt section of the fish-shell manual, from version 4.9, dated Sep 08, 2026. mwah, go make a prompt that slays. π
β¨π
π¦ where this page comes from
- arch rolling: fish 4.9.3-1 Β· GPL-2.0-only AND BSD-3-Clause AND ISC AND MIT AND PSF-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms