[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: trapping exit
>>>>> "Steve" == Steve Kilbane <steve@cegelecproj.co.uk> writes:
Steve> I'm using es 0.83.1, and I've got a user who wants to emulate .logout
Steve> functionality. It's a simple matter to put an appropriate test into
Steve> %interactive-loop when eof is caught, but how about exit? This maps
Steve> directly to $&exit, it seems, instead of having a %exit. Any suggestions?
This was discussed a while back, and if I recall correctly, the
consenus was that exit ought to throw an exception, rather than just
brutally terminate the shell:
fn exit {throw exit $*}
Then it would be up to %interactive-loop to catch the exception and do
something about it.
- Harald