From 5855dd6162f3bbeff7e75cd0246a3f85f6fefd20 Mon Sep 17 00:00:00 2001 From: tslil clingman <> Date: Sun, 1 Nov 2020 22:02:12 -0500 Subject: Fancy prompt was too fancy for emacs, but the file remains --- .bashrc | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to '.bashrc') diff --git a/.bashrc b/.bashrc index dc58285..8179a2e 100644 --- a/.bashrc +++ b/.bashrc @@ -1,3 +1,15 @@ +leftprompt() { + e=$?; (( $e )) && r="\[$(tput setaf 1)\]<$e>\[$(tput sgr0)\]" || r=""; + p=$(echo ${PWD:-?} | sed "s#.*/\(.*\)/\(.*\)#\1/\2#"); # s#$HOME#~# #${PWD##*/} + d=$(date +"%H.%M"); + v=$(vcs); + u=#; (( $(id -u) )) && u=\$; + PS1="\[$(tput sgr0)\][\[$(tput bold)\]\h:\[$(tput setaf 30)\]$p\[$(tput sgr0)\]]\ +(\[$(tput setaf 32)\]$d\[$(tput sgr0)\])$r$v\[$(tput rev)\]$u\[$(tput sgr0)\] "; +} + +PROMPT_COMMAND=leftprompt + case ${TERM} in st*|xterm*|rxvt*|Eterm|aterm|kterm|gnome*|alacritty) PROMPT_COMMAND=${PROMPT_COMMAND:+$PROMPT_COMMAND; }'printf "\033]0;%s:%s\007" "${USER}" "${PWD/#$HOME/\~}"' @@ -55,6 +67,3 @@ export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quo if [ -f ~/.bash_aliases ]; then . ~/.bash_aliases fi - -# Load the prompt -source .bashprompt -- cgit v1.2.3