From c18614552de19f66dcd337801e66ef49a647e767 Mon Sep 17 00:00:00 2001 From: Aaron Gyes Date: Mon, 31 Oct 2016 23:29:50 -0700 Subject: [PATCH] Sorin prompt: updates Use $USER, prompt_hostname, string Update to use correct color names such as magenta over purple. Use bright color variants instead of bold in some cases. --- .../web_config/sample_prompts/sorin.fish | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/share/tools/web_config/sample_prompts/sorin.fish b/share/tools/web_config/sample_prompts/sorin.fish index 59c80c2dd..9bc07d751 100644 --- a/share/tools/web_config/sample_prompts/sorin.fish +++ b/share/tools/web_config/sample_prompts/sorin.fish @@ -2,7 +2,7 @@ # author: Ivan Tham function fish_prompt - test $SSH_TTY; and printf (set_color red)(whoami)(set_color white)'@'(set_color yellow)(hostname)' ' + test $SSH_TTY; and printf (set_color red)$USER(set_color brwhite)'@'(set_color yellow)(prompt_hostname)' ' test $USER = 'root'; and echo (set_color red)"#" @@ -15,10 +15,10 @@ function fish_right_prompt test $status != 0; and printf (set_color red)"⏎ " if git rev-parse ^ /dev/null - # Purple if branch detached else green - git branch -qv | grep "\*" | grep -q detached - and set_color purple --bold - or set_color green --bold + # Magenta if branch detached else green + git branch -qv | grep "\*" | string match -rq detached + and set_color brmagenta + or set_color brgreen # Need optimization on this block (eliminate space) git name-rev --name-only HEAD @@ -32,9 +32,9 @@ function fish_right_prompt (git status --porcelain | cut -c 1-2 | uniq) switch $i case "*[ahead *" - printf (set_color purple)⬆' ' + printf (set_color magenta)⬆' ' case "*behind *" - printf (set_color purple)⬇' ' + printf (set_color magenta)⬇' ' case "." printf (set_color green)✚' ' case " D" @@ -42,13 +42,12 @@ function fish_right_prompt case "*M*" printf (set_color blue)✱' ' case "*R*" - printf (set_color purple)➜' ' + printf (set_color brmagenta)➜' ' case "*U*" - printf (set_color brown)═' ' + printf (set_color bryellow)═' ' case "??" - printf (set_color white)◼' ' + printf (set_color brwhite)◼' ' end end - set_color normal end end