mirror of
https://github.com/oh-my-fish/oh-my-fish.git
synced 2025-02-16 19:22:57 +08:00
Merge branch pull request #152 from bachue/robbyrussell_fish_prompt
This commit is contained in:
commit
2ad8fb98a0
|
@ -1,9 +1,10 @@
|
|||
## robbyrussell
|
||||
The default theme – cloned from oh-my-zsh.
|
||||
|
||||
![robbyrussell theme](http://f.cl.ly/items/2q0v3i3y2E1F0C1R3C1y/Screen%20Shot%202013-08-06%20at%2017.52.17%20.png)
|
||||
![robbyrussell theme](https://bachue.github.io/oh-my-fish/images/robbyrussell-screenshot.png)
|
||||
|
||||
|
||||
#### Characteristics
|
||||
|
||||
* 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
|
||||
|
||||
function fish_prompt
|
||||
set -l last_status $status
|
||||
set -l cyan (set_color -o cyan)
|
||||
set -l yellow (set_color -o yellow)
|
||||
set -l red (set_color -o red)
|
||||
set -l blue (set_color -o blue)
|
||||
set -l green (set_color -o green)
|
||||
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))
|
||||
|
||||
if [ (_git_branch_name) ]
|
||||
|
|
Loading…
Reference in New Issue
Block a user