mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-19 21:41:07 +01:00
add: exit code
This commit is contained in:
parent
aeca2ad899
commit
9a2376bd29
1 changed files with 6 additions and 4 deletions
|
@ -35,15 +35,16 @@ ys_hg_prompt_info() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
local exit_code="%(?,%?,%{$fg[red]%}%?%{$reset_color%})"
|
||||||
|
|
||||||
# Prompt format:
|
# 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
|
# $ COMMAND
|
||||||
#
|
#
|
||||||
# For example:
|
# 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="
|
PROMPT="
|
||||||
%{$terminfo[bold]$fg[blue]%}#%{$reset_color%} \
|
%{$terminfo[bold]$fg[blue]%}#%{$reset_color%} \
|
||||||
|
@ -54,5 +55,6 @@ PROMPT="
|
||||||
%{$terminfo[bold]$fg[yellow]%}%~%{$reset_color%}\
|
%{$terminfo[bold]$fg[yellow]%}%~%{$reset_color%}\
|
||||||
${hg_info}\
|
${hg_info}\
|
||||||
${git_info}\
|
${git_info}\
|
||||||
%{$fg[white]%}[%*] tty:%l L:%L N:%i
|
\
|
||||||
|
%{$fg[white]%}[%*] tty:%l L:%L N:%i C:$exit_code
|
||||||
%{$terminfo[bold]$fg[red]%}$ %{$reset_color%}"
|
%{$terminfo[bold]$fg[red]%}$ %{$reset_color%}"
|
||||||
|
|
Loading…
Reference in a new issue