aboutsummaryrefslogtreecommitdiffstats
path: root/fish/functions/fish_prompt.fish
diff options
context:
space:
mode:
Diffstat (limited to 'fish/functions/fish_prompt.fish')
-rw-r--r--fish/functions/fish_prompt.fish26
1 files changed, 17 insertions, 9 deletions
diff --git a/fish/functions/fish_prompt.fish b/fish/functions/fish_prompt.fish
index 57a3c21..c4e8847 100644
--- a/fish/functions/fish_prompt.fish
+++ b/fish/functions/fish_prompt.fish
@@ -1,13 +1,21 @@
-# Defined in /tmp/fish.OarydH/fish_prompt.fish @ line 2
-function fish_prompt --description 'Write out the prompt'
- if not set -q __fish_prompt_normal
- set -g __fish_prompt_normal (set_color normal)
+function fish_prompt
+ # This is a simple prompt. It looks like
+ # alfa@nobby /path/to/dir $
+ # with the path shortened and colored
+ # and a "#" instead of a "$" when run as root.
+ set -l symbol ' $ '
+ set -l color $fish_color_cwd
+ if fish_is_root_user
+ set symbol ' # '
+ set -q fish_color_cwd_root
+ and set color $fish_color_cwd_root
end
- if not set -q __fish_prompt_cwd
- set -g __fish_prompt_cwd (set_color $fish_color_cwd)
- end
+ echo -n $USER@$hostname
+
+ set_color $color
+ echo -n (prompt_pwd)
+ set_color normal
- # echo -n -s "$USER" @ (prompt_hostname) ' ' "$__fish_prompt_cwd" (prompt_pwd) (__fish_vcs_prompt) "$__fish_prompt_normal" ' ' (task +in +PENDING count) '> '
- echo -n -s "$USER" @ (prompt_hostname) ' ' "$__fish_prompt_cwd" (prompt_pwd) (__fish_vcs_prompt) "$__fish_prompt_normal"'> '
+ echo -n $symbol
end