zsh-users
 help / color / mirror / code / Atom feed
* zsh propmts
@ 1996-08-18  8:42 Robert Stone
  1996-08-18 18:43 ` Bart Schaefer
  0 siblings, 1 reply; 2+ messages in thread
From: Robert Stone @ 1996-08-18  8:42 UTC (permalink / raw)
  To: zsh-users


	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<X+d*lMLa^*lN%0]dsXx++lMlN/dsM0<j]dsj
$/=unpack('H*',$_);$_=`echo 16dio\U$k"SK$/SM$n\EsN0p[lN*1
lK[d2%Sa2/d0$^Ixp"|dc`;s/\W//g;$_=pack('H*',/((..)*)$/)



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1996-08-18 18:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-08-18  8:42 zsh propmts Robert Stone
1996-08-18 18:43 ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).