From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8210 invoked from network); 27 May 2001 05:01:30 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 27 May 2001 05:01:30 -0000 Received: (qmail 18836 invoked by alias); 27 May 2001 05:01:22 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 14492 Received: (qmail 18823 invoked from network); 27 May 2001 05:01:20 -0000 Date: Sun, 27 May 2001 01:01:17 -0400 From: Clint Adams To: zsh-workers@sunsite.dk Subject: new prompt theme Message-ID: <20010527010117.A29400@dman.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i This prompt is a stripped down modified act-a-like to something that was probably posted to one of these mailing lists about 4 years ago.. by whom I don't recall. Index: Functions/Prompts/prompt_clint_setup =================================================================== RCS file: prompt_clint_setup diff -N prompt_clint_setup --- /dev/null Thu May 24 22:33:05 2001 +++ prompt_clint_setup Sat May 26 21:46:51 2001 @@ -0,0 +1,73 @@ +# clint prompt theme + +prompt_clint_help () { + cat <<'EOF' + + prompt clint [ [ [ [ []]]]] + + defaults are red, cyan, green, yellow, and white, respectively. + +EOF +} + +prompt_clint_setup () { + local -a pcc + local -A pc + local p_date p_tty p_plat p_ver p_userpwd p_apm p_shlvlhist p_rc p_end + + pcc[1]=${1:-'red'} + pcc[2]=${2:-'cyan'} + pcc[3]=${3:-'green'} + pcc[4]=${4:-'yellow'} + pcc[5]=${5:-'white'} + + pc['\[']="%{$fg_no_bold[$pcc[1]]%}[" + pc['\]']="%{$fg_no_bold[$pcc[1]]%}]" + pc['<']="%{$fg_no_bold[$pcc[1]]%}<" + pc['>']="%{$fg_no_bold[$pcc[1]]%}>" + + p_date="$pc['\[']%{$fg_no_bold[$pcc[2]]%}%D{%a %y/%m/%d %R %Z}$pc['\]']" + p_tty="$pc['\[']%{$fg_no_bold[$pcc[3]]%}%l$pc['\]']" + p_plat="$pc['\[']%{$fg_no_bold[$pcc[2]]%}${MACHTYPE}/${OSTYPE}/$(uname -r)$pc['\]']" + p_ver="$pc['\[']%{$fg_no_bold[$pcc[2]]%}${ZSH_VERSION}$pc['\]']" + + p_userpwd="$pc['<']%{$fg_no_bold[$pcc[3]]%}%n@%m%{$fg_bold[$pcc[5]]%}:%{$fg_no_bold[$pcc[4]]%}%~$pc['>']" + [[ -f /proc/apm ]] && p_apm="%(2v.-%2v-.)" + + p_shlvlhist="%{$reset_color%}zsh%(2L./$SHLVL.) %B%h%b " + p_rc="%(?..[%?%v1] )" + p_end="%{$reset_color%}%B%#%b %{$fg_no_bold[$pcc[2]]%}" + + POSTEDIT="$reset_color" + + prompt="$p_date$p_tty$p_plat$p_ver +$p_userpwd +$p_shlvlhist$p_rc$p_apm$p_end" + PS2='%(4_.\.)%3_> %E' + + [[ -f /proc/apm ]] && + precmd () { prompt_clint_precmd ; prompt_clint_apm_precmd } || + precmd () { prompt_clint_precmd } + preexec () { } +} + +prompt_clint_precmd () { + setopt noxtrace localoptions + local exitstatus=$? + + [[ $exitstatus -ge 128 ]] && psvar[1]=" $signals[$exitstatus-127]" || + psvar[1]="" + + [[ -o interactive ]] && jobs -l + +} + +prompt_clint_apm_precmd () { + setopt noxtrace localoptions + local bat + + bat=${${="$(