mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 21:33:09 +00:00
add new file to change
This commit is contained in:
parent
07de13f61f
commit
8dfee7ff76
1 changed files with 10 additions and 0 deletions
10
share/functions/fish_prompt_hostname.fish
Normal file
10
share/functions/fish_prompt_hostname.fish
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
# Fetching the host name can be expensive if there is a problem with DNS or whatever subsystem the
|
||||||
|
# hostname command uses. So cache the answer so including it in the prompt doesn't make fish seem
|
||||||
|
# slow.
|
||||||
|
if not set -q __fish_prompt_hostname
|
||||||
|
set -g __fish_prompt_hostname (hostname | string split '.')[1]
|
||||||
|
end
|
||||||
|
|
||||||
|
function fish_prompt_hostname
|
||||||
|
echo $__fish_prompt_hostname
|
||||||
|
end
|
Loading…
Reference in a new issue