From 8b2ec9ef3449ef1142fb204426068c19a6c18749 Mon Sep 17 00:00:00 2001 From: Charles Gould Date: Sun, 22 Mar 2020 02:46:38 +0000 Subject: [PATCH] fish: only display the hostname over ssh --- fish/functions/fish_prompt.fish | 7 +++++++ fish/functions/fish_right_prompt.fish | 8 -------- 2 files changed, 7 insertions(+), 8 deletions(-) delete mode 100644 fish/functions/fish_right_prompt.fish diff --git a/fish/functions/fish_prompt.fish b/fish/functions/fish_prompt.fish index 55dfc3b..3da18d3 100644 --- a/fish/functions/fish_prompt.fish +++ b/fish/functions/fish_prompt.fish @@ -2,6 +2,13 @@ function fish_prompt --description 'Write out the prompt' # Save status code for previous command set -l last_status $status + # If we're running via SSH, display the hostname + if set -q SSH_TTY + set_color $fish_color_host_remote + echo -n "$hostname " + set_color normal + end + # Print working directory set_color $fish_color_cwd echo -n (prompt_pwd) diff --git a/fish/functions/fish_right_prompt.fish b/fish/functions/fish_right_prompt.fish deleted file mode 100644 index e83e657..0000000 --- a/fish/functions/fish_right_prompt.fish +++ /dev/null @@ -1,8 +0,0 @@ -function fish_right_prompt --description 'Write out the right prompt' - # If we're running via SSH, display the hostname - if set -q SSH_TTY - set_color $fish_color_host_remote - echo -n $hostname - set_color normal - end -end