aboutsummaryrefslogtreecommitdiffstats
path: root/fish/functions/fish_prompt.fish
diff options
context:
space:
mode:
authorMatthew Lemon <matt@matthewlemon.com>2022-10-10 12:27:18 +0100
committerMatthew Lemon <matt@matthewlemon.com>2022-10-10 12:27:18 +0100
commitdf6a7ef5adfe3a676540809ca1c479b9fade5939 (patch)
treee4c0986e1c9de6d2fd98c0c7f13388544f3ed93f /fish/functions/fish_prompt.fish
parentad90d0081b17d00caf153d82e72d6eed37ba9a69 (diff)
update
Diffstat (limited to '')
-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