mirror of
https://github.com/oh-my-fish/oh-my-fish.git
synced 2025-02-20 03:14:59 +08:00
Merge branch pull request #152 from bachue/robbyrussell_fish_prompt
This commit is contained in:
commit
2ad8fb98a0
|
@ -1,9 +1,10 @@
|
||||||
## robbyrussell
|
## robbyrussell
|
||||||
The default theme – cloned from oh-my-zsh.
|
The default theme – cloned from oh-my-zsh.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
#### Characteristics
|
#### Characteristics
|
||||||
|
|
||||||
* Displays git information in the command prompt when available.
|
* Displays git information in the command prompt when available.
|
||||||
|
* If the last command was failed, the indicator would be red, otherwise it's green
|
||||||
|
|
|
@ -8,13 +8,19 @@ function _is_git_dirty
|
||||||
end
|
end
|
||||||
|
|
||||||
function fish_prompt
|
function fish_prompt
|
||||||
|
set -l last_status $status
|
||||||
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 blue (set_color -o blue)
|
set -l blue (set_color -o blue)
|
||||||
|
set -l green (set_color -o green)
|
||||||
set -l normal (set_color normal)
|
set -l normal (set_color normal)
|
||||||
|
|
||||||
set -l arrow "$red➜ "
|
if test $last_status = 0
|
||||||
|
set arrow "$green➜ "
|
||||||
|
else
|
||||||
|
set arrow "$red➜ "
|
||||||
|
end
|
||||||
set -l cwd $cyan(basename (prompt_pwd))
|
set -l cwd $cyan(basename (prompt_pwd))
|
||||||
|
|
||||||
if [ (_git_branch_name) ]
|
if [ (_git_branch_name) ]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user