mirror of
https://github.com/oh-my-fish/oh-my-fish.git
synced 2024-11-28 03:09:31 +08:00
Added exit code in right prompt
Display name in red when user is root
This commit is contained in:
parent
6b7dfe3733
commit
36abf97c9c
|
@ -3,12 +3,10 @@
|
|||
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.
|
||||
|
||||
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)
|
||||
|
||||
TODO:
|
||||
- display latest return code
|
||||
- display escalated privileges
|
||||
- display Ruby version
|
||||
- display Python version
|
||||
|
|
|
@ -2,7 +2,13 @@
|
|||
# Some code stolen from oh-my-fish clearance theme: https://github.com/bpinto/oh-my-fish/blob/master/themes/clearance/
|
||||
|
||||
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
|
||||
|
||||
function __current_path
|
||||
|
@ -39,3 +45,11 @@ function fish_prompt
|
|||
echo -e ''
|
||||
echo (set_color white)"╰─"(set_color --bold white)"\$ "(set_color normal)
|
||||
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 |
Loading…
Reference in New Issue
Block a user