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. πŸ¦‹


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