mirror of
https://github.com/oh-my-fish/oh-my-fish.git
synced 2025-02-25 23:03:26 +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
|
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.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
TODO:
|
TODO:
|
||||||
- display latest return code
|
|
||||||
- display escalated privileges
|
|
||||||
- display Ruby version
|
- display Ruby version
|
||||||
- display Python 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/
|
# 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 |
Loading…
x
Reference in New Issue
Block a user