From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from euclid.skiles.gatech.edu (root@euclid.skiles.gatech.edu [130.207.146.50]) by coral.primenet.com.au (8.7.5/8.7.3) with ESMTP id VAA01173 for ; Sun, 18 Aug 1996 21:22:08 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id FAA07089; Sun, 18 Aug 1996 05:48:30 -0400 (EDT) Resent-Date: Sun, 18 Aug 1996 04:44:40 -0400 (EDT) Date: Sun, 18 Aug 1996 03:42:47 -0500 (CDT) From: Robert Stone To: zsh-users@math.gatech.edu Subject: zsh propmts Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Resent-Message-ID: <"1zSIP.0.de1.uVj5o"@euclid> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/360 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu I'd like to thank everyone who had anything to do with the "%_" value for PS2 in zsh-3.0.0, I'm in love with it. I've been attempting to set up a prompt that will show me any non-zero return values, and print the names of any signal the last job recieved. Right now I'm using two features of the shell to accomplish this: function precmd { PSVAR=$signals[$?^128+1] } PROMPT='%(?..%1(?.{%?}.%B{%?%2(v.. %v)}%b) )%m:%~%# ' Unfortunately I end up with $PSVAR = '.' if no signal has occured because an invalid array subscription produces '.', such that my prompt looks like: aic1:~% return 15 {15 .} aic1:~% ls -l # I hit ^C here {130 INT} darkstar:~% The trick here is that I can't execute anything in precmd that would effect $? or the "%?" value in the prompt is inaccurate. How could I clean this so that PSVAR is set to a null string when $signals is given an invalid subscript? thanks, Robert Stone ------------------rstone@accesscom.com------------------- #!/bin/perl -sp0777i