mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-04-24 11:41:15 -03:00
Add documentation for prompt_hostname
This commit is contained in:
committed by
Fabian Homborg
parent
bea86f04c7
commit
e79617f4b7
27
doc_src/cmds/prompt_hostname.rst
Normal file
27
doc_src/cmds/prompt_hostname.rst
Normal file
@@ -0,0 +1,27 @@
|
||||
.. _cmd-prompt_hostname:
|
||||
|
||||
prompt_hostname - print the hostname, shortened for use in the prompt
|
||||
=====================================================================
|
||||
|
||||
Synopsis
|
||||
--------
|
||||
|
||||
::
|
||||
|
||||
function fish_prompt
|
||||
echo -n (whoami)@(prompt_hostname) (prompt_pwd) '$ '
|
||||
end
|
||||
|
||||
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
|
||||
--------
|
||||
|
||||
::
|
||||
|
||||
# The machine's full hostname is foo.bar.com
|
||||
>_ prompt_hostname
|
||||
foo
|
||||
Reference in New Issue
Block a user