Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Execute a Command in PS1 w/o Disturbing Previous Return Value?



* Aaron Davies <agdavi01@xxxxxxxxxxxxxx> [2004-08-14 12:07 -0400]:
> I dunno, I can see where someone might want a prompt so complicated it 
> needed internal error-handling based on return value of executed 
> commands (cat foo || cat bar, etc.). Would "fixing" this prevent that?

Shouldn't.  IIRC, the code for precmd is as simple as saving $? at the
beginning and then restoring it at the end.

(I ran into this problem a while ago and solved it by simply moving all
execution into precmd().)

-- 
...computer contrarian of the first order... / http://aperiodic.net/phil/
PGP: 026A27F2  print: D200 5BDB FC4B B24A 9248  9F7A 4322 2D22 026A 27F2
--- --
You can't wake a person who is pretending to be asleep.
                       -- Navajo Proverb
---- --- --



Messages sorted by: Reverse Date, Date, Thread, Author