mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 04:43:10 +00:00
include exit status indicator in robbyrussell sample prompt
This commit is contained in:
parent
98f4e49669
commit
b4f70cb98b
1 changed files with 9 additions and 2 deletions
|
@ -2,6 +2,7 @@
|
|||
# author: Bruno Ferreira Pinto, Pawel Zubrycki
|
||||
|
||||
function fish_prompt
|
||||
set -l __last_command_exit_status $status
|
||||
|
||||
if not set -q -g __fish_robbyrussell_functions_defined
|
||||
set -g __fish_robbyrussell_functions_defined
|
||||
|
@ -58,12 +59,18 @@ function fish_prompt
|
|||
set -l cyan (set_color -o cyan)
|
||||
set -l yellow (set_color -o yellow)
|
||||
set -l red (set_color -o red)
|
||||
set -l green (set_color -o green)
|
||||
set -l blue (set_color -o blue)
|
||||
set -l normal (set_color normal)
|
||||
|
||||
set -l arrow "$red➜ "
|
||||
set -l arrow_color "$green"
|
||||
if test $__last_command_exit_status != 0
|
||||
set arrow_color "$red"
|
||||
end
|
||||
|
||||
set -l arrow "$arrow_color➜ "
|
||||
if [ $USER = 'root' ]
|
||||
set arrow "$red# "
|
||||
set arrow "$arrow_color# "
|
||||
end
|
||||
|
||||
set -l cwd $cyan(basename (prompt_pwd))
|
||||
|
|
Loading…
Reference in a new issue