From cb130473a863cdeb3749d53d37894d6b9155975b Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Mon, 4 Oct 2021 00:17:44 +0200 Subject: [PATCH] Another fix for the bug in the prompt --- functions/fish_prompt.fish | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/functions/fish_prompt.fish b/functions/fish_prompt.fish index 88ca683..588465c 100644 --- a/functions/fish_prompt.fish +++ b/functions/fish_prompt.fish @@ -39,8 +39,11 @@ function fish_prompt set -g CURRENT_IP (who am i | awk '{print $5}') if test -z "$CURRENT_IP" - # Experiment - set -g CURRENT_IP (who | grep "$USER" | awk '{print $5}') + set -g "CURRENT_IP" (who | grep "$USER" | awk '{print $5}') + end + + if test -z "$CURRENT_IP" + set -g "CURRENT_IP" (who | grep "$SUDO_USER" | awk '{print $5}') end if test -z "$CURRENT_IP"