mirror of
https://github.com/fish-shell/fish-shell
synced 2024-11-14 17:07:44 +00:00
14d60ccb32
A great leap forward
29 lines
614 B
ReStructuredText
29 lines
614 B
ReStructuredText
.. _cmd-prompt_hostname:
|
|
|
|
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_prompt
|
|
echo -n (whoami)@(prompt_hostname) (prompt_pwd) '$ '
|
|
end
|
|
|
|
::
|
|
|
|
# The machine's full hostname is foo.bar.com
|
|
>_ prompt_hostname
|
|
foo
|