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

Re: trap DEBUG should get run beforehand, not afterwards.



"Rocky Bernstein" wrote:
> Think for example about whether you'd like to know that 'rm -fr *' is
> about to occur or just occurred.
> 
> ksh introduced trap DEBUG and bash, and zsh copied it. Both ksh and
> bash originally ran after the statement; I guess because that is same
> as other traps. However both have switched so that it is run before
> the statement.
> 
> Alas, it's impossible to contemplate writing any sort of serious
> debugger unless  "trap DEBUG" gets run beforehand.

Use the option DEBUG_BEFORE_CMD.

-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070



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