make the ssh agent visual

This commit is contained in:
Felix Van der Jeugt 2018-11-30 10:01:33 +01:00
parent 9242f19b25
commit 5c5c24dd1a
No known key found for this signature in database
GPG Key ID: 58B209295023754D

5
bashrc
View File

@ -14,6 +14,9 @@ prompt_git() {
prompt_pwd() { prompt_pwd() {
pwd | sed -e "s_${HOME}_~_" -e 's_\(/*\.*.\)[^/]*/_\1/_g' pwd | sed -e "s_${HOME}_~_" -e 's_\(/*\.*.\)[^/]*/_\1/_g'
} }
prompt_agent() {
[ -z "$SSH_AGENT_PID" ] || echo " (A)"
}
prompt_status() { prompt_status() {
if [ "$?" = "0" ] if [ "$?" = "0" ]
then echo "$" then echo "$"
@ -23,7 +26,7 @@ prompt_status() {
BOLD="\001$(tput bold)\002" BOLD="\001$(tput bold)\002"
GREEN="\001$(tput setaf 2)\002" GREEN="\001$(tput setaf 2)\002"
RESET="\001$(tput sgr0)\002" RESET="\001$(tput sgr0)\002"
PS1="$BOLD[\t]$RESET $GREEN\$(ks prompt_pwd)$RESET\$(ks prompt_git) \$(prompt_status) " PS1="$BOLD[\t]$RESET $GREEN\$(ks prompt_pwd)$RESET\$(ks prompt_git)\$(ks prompt_agent) \$(prompt_status) "
unset BOLD unset BOLD
unset GREEN unset GREEN
unset RESET unset RESET