mirror of
https://github.com/lloeki/dotfiles.git
synced 2025-12-06 07:24:39 +01:00
Attempt aligning bash with zsh
- support PROMPT - support RPROMPT (buggy if on same line) - support zsh color codes in PROMPT and RPROMPT - refactor set_prompt to use PROMPT and RPROMPT - add duration and rc to RPROMPT
This commit is contained in:
parent
3c3b89831b
commit
bbd976f569
3 changed files with 95 additions and 22 deletions
16
bash/rc
16
bash/rc
|
|
@ -19,14 +19,28 @@ GIT_PS1_SHOWSTASHSTATE=1
|
|||
GIT_PS1_SHOWUNTRACKEDFILES=1
|
||||
|
||||
precmd() {
|
||||
LAST_CMD_RC=$?
|
||||
CMD_RC=$?
|
||||
|
||||
if [[ -n ${CMD_START} ]]; then
|
||||
CMD_END="${EPOCHREALTIME}"
|
||||
CMD_DURATION=$(bc <<<"${CMD_END} - ${CMD_START}")
|
||||
unset CMD_START
|
||||
unset CMD_END
|
||||
fi
|
||||
|
||||
_direnv_hook
|
||||
#clear_incomplete_line
|
||||
set_prompt
|
||||
apply_prompt_rprompt
|
||||
update_terminal_cwd
|
||||
set_term_title
|
||||
}
|
||||
|
||||
preexec() {
|
||||
set_term_title
|
||||
CMD_START="${EPOCHREALTIME}"
|
||||
}
|
||||
|
||||
chpwd() {
|
||||
__git_ps1_gitdir
|
||||
_gopath
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue