mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-13 05:28:49 +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
|
# author: Bruno Ferreira Pinto, Pawel Zubrycki
|
||||||
|
|
||||||
function fish_prompt
|
function fish_prompt
|
||||||
|
set -l __last_command_exit_status $status
|
||||||
|
|
||||||
if not set -q -g __fish_robbyrussell_functions_defined
|
if not set -q -g __fish_robbyrussell_functions_defined
|
||||||
set -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 cyan (set_color -o cyan)
|
||||||
set -l yellow (set_color -o yellow)
|
set -l yellow (set_color -o yellow)
|
||||||
set -l red (set_color -o red)
|
set -l red (set_color -o red)
|
||||||
|
set -l green (set_color -o green)
|
||||||
set -l blue (set_color -o blue)
|
set -l blue (set_color -o blue)
|
||||||
set -l normal (set_color normal)
|
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' ]
|
if [ $USER = 'root' ]
|
||||||
set arrow "$red# "
|
set arrow "$arrow_color# "
|
||||||
end
|
end
|
||||||
|
|
||||||
set -l cwd $cyan(basename (prompt_pwd))
|
set -l cwd $cyan(basename (prompt_pwd))
|
||||||
|
|
Loading…
Reference in a new issue