commit: 8520b6a4ab3537a921c9dfc225d3386e20c1e396
parent: b43a884e15bb3118b567449ef7364e447cb84585
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Mon, 23 Dec 2019 17:45:03 +0100
.profile: git-branch to mksh-only, add $? & date to PS1
Diffstat:
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/.profile b/.profile
@@ -107,9 +107,9 @@ get_git_branch() {
branch='@.'
fi
- printf -- '[41;36m[30m %s[0;31m' "$branch"
+ printf -- '[41;36m[30m %s[0;31m' "$branch"
else
- echo '[0;36m'
+ echo '[0;36m'
fi
}
@@ -128,14 +128,14 @@ esac
case $SHELL in
*ksh*)
# hack derived from ksh88(1), works in mksh, doesn't works in bash
- export PS1='
[40;32m${USER}[${host_ansi}m@$(hostname)[30;46m$(get_working_directory)$(get_git_branch)[0m '
+ export PS1='
[47;30m$?[37;100m[100;30m$(date +w%wT%T)[40;90m[40;32m${USER}[${host_ansi}m@$(hostname)[30;46m$(get_working_directory)$(get_git_branch)[0m '
;;
*bash*)
- export PS1='\[\e[40;32m\]\u\[\e[${host_ansi}m\]@\h\]\[\e[30;46m\]$(get_working_directory)$(get_git_branch)\[\e[0m\] '
+ export PS1='\[\e[47;30m\]$?\[\e[37;100m\]\[\e[100;30m\]$(date +w%wT%T)\[\e[40;90m\]\[\e[40;32m\]\u\[\e[${host_ansi}m\]@\h\]\[\e[30;46m\]$(get_working_directory)\[\e[0;36m\]\[\e[0m\] '
;;
*)
# Don't even try escape codes, and so no powerline-style
- export PS1='$USER${HOSTNAME:=$(hostname)} $(get_working_directory) $(get_git_branch) > '
+ export PS1='$? $(date +w%wT%T) $USER@${HOSTNAME:=$(hostname)} $(get_working_directory) $(get_git_branch) > '
;;
esac