From 8dfee7ff76b3eff03ea502173230adf2171ed253 Mon Sep 17 00:00:00 2001 From: Kurtis Rader Date: Sun, 23 Oct 2016 14:56:18 -0700 Subject: [PATCH] add new file to change --- share/functions/fish_prompt_hostname.fish | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 share/functions/fish_prompt_hostname.fish diff --git a/share/functions/fish_prompt_hostname.fish b/share/functions/fish_prompt_hostname.fish new file mode 100644 index 000000000..be9fba9dc --- /dev/null +++ b/share/functions/fish_prompt_hostname.fish @@ -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