Added exit code in right prompt

Display name in red when user is root
This commit is contained in:
Vincent Pretre 2014-03-11 20:21:48 +01:00 committed by Bruno Pinto
parent 6b7dfe3733
commit 36abf97c9c
3 changed files with 16 additions and 4 deletions

View File

@ -3,12 +3,10 @@
Theme imported from Oh my ZSH: https://github.com/robbyrussell/oh-my-zsh/blob/master/themes/bira.zsh-theme Theme imported from Oh my ZSH: https://github.com/robbyrussell/oh-my-zsh/blob/master/themes/bira.zsh-theme
Contains traces of nuts and code from other Oh my fish themes. Contains traces of nuts and code from other Oh my fish themes.
Display username, hostname, current path and git status: Display username, hostname, current path and git status. Display the latest error status in the right prompt.
![bira theme](https://raw.github.com/vincent-psarga/oh-my-fish/master/themes/bira/screenshot.png) ![bira theme](https://raw.github.com/vincent-psarga/oh-my-fish/master/themes/bira/screenshot.png)
TODO: TODO:
- display latest return code
- display escalated privileges
- display Ruby version - display Ruby version
- display Python version - display Python version

View File

@ -2,7 +2,13 @@
# Some code stolen from oh-my-fish clearance theme: https://github.com/bpinto/oh-my-fish/blob/master/themes/clearance/ # Some code stolen from oh-my-fish clearance theme: https://github.com/bpinto/oh-my-fish/blob/master/themes/clearance/
function __user_host function __user_host
echo -n (set_color --bold green)$USER@(hostname|cut -d . -f 1) (set color normal) set -l content
if [ (id -u) = "0" ];
echo -n (set_color red)
else
echo -n (set_color green)
end
echo -n $USER@(hostname|cut -d . -f 1) (set color normal)
end end
function __current_path function __current_path
@ -39,3 +45,11 @@ function fish_prompt
echo -e '' echo -e ''
echo (set_color white)"╰─"(set_color --bold white)"\$ "(set_color normal) echo (set_color white)"╰─"(set_color --bold white)"\$ "(set_color normal)
end end
function fish_right_prompt
set -l st $status
if [ $st != 0 ];
echo (set_color red)$st(set_color normal)
end
end

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

After

Width:  |  Height:  |  Size: 30 KiB