summaryrefslogtreecommitdiffstats
path: root/.config/fish/functions/fish_prompt.fish
diff options
context:
space:
mode:
Diffstat (limited to '.config/fish/functions/fish_prompt.fish')
-rw-r--r--.config/fish/functions/fish_prompt.fish24
1 files changed, 9 insertions, 15 deletions
diff --git a/.config/fish/functions/fish_prompt.fish b/.config/fish/functions/fish_prompt.fish
index 762a448..06b4309 100644
--- a/.config/fish/functions/fish_prompt.fish
+++ b/.config/fish/functions/fish_prompt.fish
@@ -1,22 +1,16 @@
function fish_prompt --description 'Write out the prompt'
- set -l normal (set_color normal)
- set -l color_cwd $fish_color_cwd
- set -l color_host $fish_color_host
- set -l suffix '>'
+ set -l color_cwd (set_color $fish_color_cwd)
+ set -l color_host (set_color $fish_color_host_remote)
+ set -l reset (set_color normal)
- # Color the prompt differently when we're root
- if contains -- $USER root toor
- if set -q fish_color_cwd_root
- set color_cwd $fish_color_cwd_root
- end
- set suffix '#'
- end
+ set -l hostinfo ''
+ set -l suffix '$'
- # If we're running via SSH, change the host color
+ # If we're running via SSH, display the hostname and change color.
if set -q SSH_TTY
- set color_host $fish_color_host_remote
+ set hostinfo $color_host $USER @ (prompt_hostname) $reset " "
end
- echo -n -s (set_color $fish_color_user) "$USER" $normal @ (set_color $color_host) (prompt_hostname) $normal ' ' \
- (set_color $color_cwd) (prompt_pwd) $normal (git-sonar -f) $normal " " $suffix " "
+ # prompt
+ echo -n -s $hostinfo $color_cwd (prompt_pwd) $reset (git-sonar -f) $reset " " $suffix " "
end