Files
fish-shell/doc_src/cmds/prompt_hostname.rst
Johannes Altmanninger 7a59540517 docs: use :doc: role when referencing entire pages
No need to define "cmd-foo" anchors; use :doc:`foo <cmds/foo>`
instead. If we want "cmd-foo" but it should be tested.

See also 38b24c2325 (docs: Use :doc: role when linking to commands,
2022-09-23).
2025-11-06 12:58:59 +01:00

30 lines
603 B
ReStructuredText

prompt_hostname - print the hostname, shortened for use in the prompt
=====================================================================
Synopsis
--------
.. 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_prompt
echo -n (whoami)@(prompt_hostname) (prompt_pwd) '$ '
end
::
# The machine's full hostname is foo.bar.com
>_ prompt_hostname
foo