PROMPT_HOSTNAME(1)

πŸ¦‹ PROMPT_HOSTNAME(1) πŸ¦‹

okay so this is a page from the fish-shell manual, and it's literally the shortest little glow-up you've ever seen. bestie, it's so chill.


✨ NAME ✨

prompt_hostname β€” prints the hostname, shortened, for use in the prompt πŸ’…


🌸 SYNOPSIS 🌸

prompt_hostname

that's it. that's the whole synopsis. she's low maintenance, she's iconic, she ate and left no crumbs πŸŽ€


πŸ’– DESCRIPTION πŸ’–

okay so prompt_hostname prints a shortened version of the current hostname, specifically for use in the prompt. and by "shortened" we mean it prints just the first component of the hostname β€” like, everything up to the first dot, and nothing after it. periodt. 🫢

so if your machine is being all extra with a big long name, this bad boy gives you the main-character part only.


🌈 EXAMPLES 🌈

here's the vibe in action β€” dropping it into a fish_prompt function like the queen she is πŸ‘‘

function fish_prompt
    echo -n (whoami)@(prompt_hostname) (prompt_pwd) '$ '
end

# The machine's full hostname is foo.bar.com
>_ prompt_hostname
foo

see how the machine's full hostname is foo.bar.com but prompt_hostname was like "no bestie, we're giving foo" 😭 so clean, so demure.


fish-shell developers 🐟


okay that's the whole page, you're officially a prompt_hostname expert, no cap πŸ’œ this little gem is from fish-shell 4.9, dated Sep 08, 2026, and the copyright belongs to the fish-shell developers β€” go forth and shorten those hostnames, bestie πŸ§šβ€β™€οΈβ­

πŸ“¦ 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