From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gatech.edu (gatech.edu [130.207.244.244]) by werple.mira.net.au (8.6.12/8.6.9) with SMTP id QAA06141 for ; Thu, 20 Jul 1995 16:22:42 +1000 Received: from math (math.skiles.gatech.edu) by gatech.edu with SMTP id AA22824 (5.65c/Gatech-10.0-IDA for ); Thu, 20 Jul 1995 02:16:50 -0400 Received: by math (5.x/SMI-SVR4) id AA24356; Thu, 20 Jul 1995 02:13:23 -0400 Resent-Date: Thu, 20 Jul 1995 16:01:11 +1000 Old-Return-Path: Message-Id: <9507200601.AA00713@buddha.unico> X-Mailer: exmh version 1.6.2 7/18/95 To: zsh-workers@math.gatech.edu Subject: Re: can this be done? In-Reply-To: csdayton's message of Tue, 18 Jul 1995 15:16:51 -0500. <199507182016.PAA02493@woodlawn.uchicago.edu> X-Attribution: ajc X-Uri: X-Face: PBPJ+.AE`FBN4$}H rwwEhJ)x?-5$MQ%Z)svNR@Q\WG6[GDr,}a@8ULwGWBsk,Pqxm!Z- Date: Thu, 20 Jul 1995 16:01:11 +1000 From: Andrew J Cosgriff Resent-Message-Id: <"1Nx6B2.0.Qy5.1GV3m"@math> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/248 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu Soren Dayton wrote: >Could you do something like display the current command line in a color? >Note that this is _only_ the current line. Here's my color prompt stuff again. Current command line is in cyan. POSTEDIT is set to turn text back to white afterwards... --cut-- if [[ "$USE_COLOR" = "" ]] && [[ "$TERM" != "sun" ]] then export USE_COLOR=yes else export USE_COLOR=${USE_COLOR:-no} fi # # Prompt stuff # PS2='%(4_.\.\.\. .)%3_> %E' function precmd { # Look at exit status of last command - attach appropriate signal # if it was a signal that caused it. local exitstatus=$? if [[ $exitstatus -ge 128 ]] then psvar[1]=" $signals[$exitstatus-127]" else psvar[1]="" fi if [[ -o interactive ]] then jobs -l fi } HOSTVER=`uname -r` [[ $HOSTTYPE = sun4 || $HOSTTYPE = solaris2.3]] && HOSTARCH=`arch -k` || HOSTARC H=$HOSTTYPE function prompt-mode () { case $1 { all | ALL | on | ON) prompt="$date_prompt $dir_prompt $main_prompt" ;; dir | DIR) prompt="$dir_prompt $main_prompt" ;; date | DATE) prompt="$date_prompt $main_prompt" ;; off | OFF) prompt="$main_prompt" ;; right|RIGHT) RPS1="$right_prompt";; noright|NORIGHT) RPS1="";; *) echo "Syntax : $0 [on|off|all|dir] on|all : Turn on the full prompt. dir : Show the current directory line. date : Show the date line. off : history line only. right : turn on right prompt. noright : turn off right prompt" ;; } } alias prm=prompt-mode if [[ $USE_COLOR = yes ]] then ]] && export COLOR_HILIT="1;" [[ $TERM = vs100 ]] && unset COLOR_HILIT date_prompt="%{ESC[${COLOR_HILIT}31m%}[%{ESC[36m%}%D{%a %y/%m/%d %R %Z}%{ESC[31m %}][%{ESC[32m%}tty%l%{ESC[31m%}][%{ESC[36m%}${HOSTARCH}/${HOSTVER}%{ESC[31m%}]" dir_prompt="%{ESC[${COLOR_HILIT}31m%}<%{ESC[32m%}%n@%m%{ESC[37m%}:%{ESC[33m%}%~ % {ESC[31m%}>%{ESC[0m%}" main_prompt="%{ESC[0m%}zsh%(2L./$SHLVL.) %B%h%b %(?..[%?%v] )%B%#%b %{ESC[0;36m% }" POSTEDIT="ESC[37;0m" right_prompt="[%T]" else date_prompt="[%B%D{%a %y/%m/%d %R %Z}%b][tty%l][%B${HOSTARCH}/${HOSTVER}%b]" dir_prompt="<%B%n@%m:%~%b>" main_prompt="zsh%(2L./$SHLVL.) %B%h%b %(?..[%?%v] )%B%#%b " right_prompt="[%T]" fi prompt-mode off prompt-mode right if [[ "$TERM" = "emacs" ]] then export USE_COLOR=no prompt="%n@%m:%~ zsh(emacs) %h %(?..[%?%v] )%# " fi --end-- Enjoy, Andrew. - Andrew J. Cosgriff - andrew@unico.com.au - SysAdmin, UNICO Computer Systems. email fileserver : "send file help" as subject PGP, MIME ok & preferred "There are ten million stories in the Naked City, but no-one can remember which one is theirs..." (Laurie Anderson) - Andrew J. Cosgriff - andrew@unico.com.au - SysAdmin, UNICO Computer Systems. email fileserver : "send file help" as subject PGP, MIME ok & preferred "There are ten million stories in the Naked City, but no-one can remember which one is theirs..." (Laurie Anderson)