diff options
author | Fabian Homborg <FHomborg@gmail.com> | 2015-09-15 21:13:43 +0200 |
---|---|---|
committer | Fabian Homborg <FHomborg@gmail.com> | 2015-09-15 21:14:49 +0200 |
commit | c8ac48ff9ac934611b028fad08789b25e7f5853b (patch) | |
tree | 0303df94cc2cc29a581ffed1f134cd891105033b /share/tools | |
parent | fa4ec55c96d3c4233394a90958ea87a0ba90fc91 (diff) |
Informative git prompt: Handle root/toor users
Fixes #961
This should probably be in a helper function
Diffstat (limited to 'share/tools')
-rw-r--r-- | share/tools/web_config/sample_prompts/informative_git.fish | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/share/tools/web_config/sample_prompts/informative_git.fish b/share/tools/web_config/sample_prompts/informative_git.fish index 4562ef36..6af67cd8 100644 --- a/share/tools/web_config/sample_prompts/informative_git.fish +++ b/share/tools/web_config/sample_prompts/informative_git.fish @@ -65,8 +65,23 @@ function fish_prompt --description 'Write out the prompt' set -g __fish_prompt_normal (set_color normal) end + set -l color_cwd + set -l prefix + switch $USER + case root toor + if set -q fish_color_cwd_root + set color_cwd $fish_color_cwd_root + else + set color_cwd $fish_color_cwd + end + set suffix '#' + case '*' + set color_cwd $fish_color_cwd + set suffix '$' + end + # PWD - set_color $fish_color_cwd + set_color $color_cwd echo -n (prompt_pwd) set_color normal @@ -76,7 +91,7 @@ function fish_prompt --description 'Write out the prompt' set_color $fish_color_error end - echo -n '$ ' + echo -n "$suffix " set_color normal end |