mirror of
https://github.com/lloeki/dotfiles.git
synced 2025-12-06 07:24:39 +01:00
Add right prompt with duration and rc
This commit is contained in:
parent
d847fb297b
commit
3c3b89831b
2 changed files with 24 additions and 1 deletions
12
zsh/prompt
12
zsh/prompt
|
|
@ -176,6 +176,18 @@ set_prompt() {
|
|||
|
||||
buffer="${buffer}%f> "
|
||||
PROMPT="${buffer}"
|
||||
|
||||
local rbuffer=""
|
||||
|
||||
if [[ ${CMD_DURATION:-0} -gt 0 ]]; then
|
||||
printf -v formatted_duration "%.3f" "${CMD_DURATION}"
|
||||
|
||||
rbuffer=" %F{yellow}${formatted_duration}s${rbuffer}"
|
||||
fi
|
||||
|
||||
[[ ${CMD_RC} -ne 0 ]] && rbuffer=" %F{red}${CMD_RC}${rbuffer}"
|
||||
|
||||
RPROMPT="${rbuffer}%f"
|
||||
}
|
||||
|
||||
# vim: ft=zsh
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue