From 332f23abd7a095d5b2c024a061af7b890a4f0c20 Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Fri, 5 Nov 2021 10:16:55 -0400 Subject: [PATCH] Use more portable `uname -n` rather than `hostname`. Fixes #312 --- functions/fish_prompt.fish | 2 +- functions/fish_title.fish | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/functions/fish_prompt.fish b/functions/fish_prompt.fish index 02bfe97..6b441b5 100644 --- a/functions/fish_prompt.fish +++ b/functions/fish_prompt.fish @@ -690,7 +690,7 @@ end # Polyfill for fish < 2.5.0 if not type -q prompt_hostname if not set -q __bobthefish_prompt_hostname - set -g __bobthefish_prompt_hostname (hostname | string replace -r '\..*' '') + set -g __bobthefish_prompt_hostname (uname -n | string replace -r '\..*' '') end function prompt_hostname diff --git a/functions/fish_title.fish b/functions/fish_title.fish index a14e1b6..67f34d2 100644 --- a/functions/fish_title.fish +++ b/functions/fish_title.fish @@ -8,7 +8,7 @@ function __bobthefish_title_user -S -d 'Display actual user if different from $d if [ "$theme_title_display_user" = 'yes' ] if [ "$USER" != "$default_user" -o -n "$SSH_CLIENT" ] set -l IFS . - hostname | read -l hostname __ + uname -n | read -l hostname __ echo -ns (whoami) '@' $hostname ' ' end end