Back to Fish

prompt_hostname - print the hostname, shortened for use in the prompt¶

site/docs/4.1/cmds/prompt_hostname.html

latest697 B
Original Source

prompt_hostname - print the hostname, shortened for use in the prompt

Synopsis

prompt\_hostname

Description

prompt_hostname prints a shortened version the current hostname for use in the prompt. It will print just the first component of the hostname, everything up to the first dot.

Examples

function fish\_promptecho -n (whoami)@(prompt\_hostname) (prompt\_pwd) '$ 'end
# The machine's full hostname is foo.bar.com\>\_ prompt\_hostnamefoo