bashrc: Add function to print compilater in prompt

This commit is contained in:
Mickaël Tansorier committed 2022-11-08 17:37:25 +01:00
1 parent d2bf30770d
commit 91e23be94f
1 file changed
+10 -2
+10 -2
View File
@@ -32,10 +32,18 @@ print_time() {
printf "%*s%s\r" "$(tput cols)" "($(date +%H:%M))" printf "%*s%s\r" "$(tput cols)" "($(date +%H:%M))"
} }
# print cc compilater
print_cc() {
if [ ! -z "${CC}" ]
then
echo ${CC} | awk '{print " ["$1"]";}'
fi
}
# prompt sans heure # prompt sans heure
PS1='\[\033[00;35m\][${debian_chroot:+($debian_chroot)}\u@\h\[\033[00;35m\]:\[\033[00;36m\]\w\[\033[00;35m\]]\[\033[00;31m\]$(parse_git_branch)\n\[\033[00m\]\$ ' PS1='\[\033[00;35m\][${debian_chroot:+($debian_chroot)}\u@\h\[\033[00;35m\]:\[\033[00;36m\]\w\[\033[00;35m\]]\[\033[00;31m\]$(parse_git_branch)\[\033[00;34m\]$(print_cc)\n\[\033[00m\]\$ '
# prompt avec heure # prompt avec heure
PS1='\[\033[00;33m\]$(print_time)\[\033[00;35m\][${debian_chroot:+($debian_chroot)}\u@\h\[\033[00;35m\]:\[\033[00;36m\]\w\[\033[00;35m\]]\[\033[00;31m\]$(parse_git_branch)\n\[\033[00m\]\$ ' PS1='\[\033[00;33m\]$(print_time)\[\033[00;35m\][${debian_chroot:+($debian_chroot)}\u@\h\[\033[00;35m\]:\[\033[00;36m\]\w\[\033[00;35m\]]\[\033[00;31m\]$(parse_git_branch)\[\033[00;34m\]$(print_cc)\n\[\033[00m\]\$ '
### Completion ### ### Completion ###