diff options
author | Yad Smood <y.s.inside@gmail.com> | 2016-02-21 02:42:42 +0800 |
---|---|---|
committer | Yad Smood <y.s.inside@gmail.com> | 2016-02-21 02:42:42 +0800 |
commit | 9a2376bd29682d9b1c42eb4e0223aacbb784f0fb (patch) | |
tree | 680fcb2f9d6f20cf7855f49ccd35e80219f74ee1 | |
parent | aeca2ad899eed0235921dc6f1d7a3415bc851143 (diff) | |
download | zsh-9a2376bd29682d9b1c42eb4e0223aacbb784f0fb.tar.gz zsh-9a2376bd29682d9b1c42eb4e0223aacbb784f0fb.tar.bz2 zsh-9a2376bd29682d9b1c42eb4e0223aacbb784f0fb.zip |
add: exit code
-rw-r--r-- | themes/ys.zsh-theme | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/themes/ys.zsh-theme b/themes/ys.zsh-theme index d08453350..737b506be 100644 --- a/themes/ys.zsh-theme +++ b/themes/ys.zsh-theme @@ -35,15 +35,16 @@ ys_hg_prompt_info() { fi } +local exit_code="%(?,%?,%{$fg[red]%}%?%{$reset_color%})" # Prompt format: # -# PRIVILEGES USER @ MACHINE in DIRECTORY on git:BRANCH STATE [TIME] L:SHELL_LEVEL N:LINE_NUM +# PRIVILEGES USER @ MACHINE in DIRECTORY on git:BRANCH STATE [TIME] tty:$TTY L:$SHELL_LEVEL N:LINE_NUM C:LAST_EXIT_CODE # $ COMMAND # # For example: # -# % ys @ ys-mbp in ~/.oh-my-zsh on git:master x [21:47:42] tty:s000 L:1 N:12 +# % ys @ ys-mbp in ~/.oh-my-zsh on git:master x [21:47:42] tty:s000 L:1 N:12 C:0 # $ PROMPT=" %{$terminfo[bold]$fg[blue]%}#%{$reset_color%} \ @@ -53,6 +54,7 @@ PROMPT=" %{$fg[white]%}in \ %{$terminfo[bold]$fg[yellow]%}%~%{$reset_color%}\ ${hg_info}\ -${git_info} \ -%{$fg[white]%}[%*] tty:%l L:%L N:%i +${git_info}\ + \ +%{$fg[white]%}[%*] tty:%l L:%L N:%i C:$exit_code %{$terminfo[bold]$fg[red]%}$ %{$reset_color%}" |