From 12f1b59a09855a4697a30539a2225d1fee8b5536 Mon Sep 17 00:00:00 2001 From: Von Random Date: Mon, 19 Jun 2023 14:19:03 +0300 Subject: [PATCH] fish: show username@host over ssh --- cli/.config/fish/functions/fish_prompt.fish | 1 + cli/.config/fish/functions/prompt.user.fish | 5 +++++ 2 files changed, 6 insertions(+) create mode 100644 cli/.config/fish/functions/prompt.user.fish diff --git a/cli/.config/fish/functions/fish_prompt.fish b/cli/.config/fish/functions/fish_prompt.fish index ff8af6e..cf683ec 100644 --- a/cli/.config/fish/functions/fish_prompt.fish +++ b/cli/.config/fish/functions/fish_prompt.fish @@ -1,6 +1,7 @@ function fish_prompt set -g prompt_string set -g prev_color + prompt.user prompt.add blue (prompt_pwd) prompt.git prompt.add normal $prompt_bang diff --git a/cli/.config/fish/functions/prompt.user.fish b/cli/.config/fish/functions/prompt.user.fish new file mode 100644 index 0000000..102c768 --- /dev/null +++ b/cli/.config/fish/functions/prompt.user.fish @@ -0,0 +1,5 @@ +function prompt.user + if test -n "$SSH_CLIENT" || string match -qe root "$USER" + prompt.add black $USER@$hostname + end +end