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

RE: exit status of interactive shell



> 
> when leaving a shell, the return status is that of the last command.
> This makes sense, especially for scripts. But in an interactive shell,
> it's
> sometimes a little surprising. I use konsole as terminal app and it
> displays
> the exit status if != 0 when a session is closed. Now when the session was
> an
> interactive shell in which the last command failed/has been killed, this
> is
> displayed.
> Is there a way to make an interactive zsh always exit with 0 status unless
> the
> shell itself died uncleanly?
> 


presumably you could try to trap EXIT in zshrc.

trap 'exit 0' EXIT

BTW should exit code be changeable by EXIT block? Currently doing

trap 'return 0' EXIT

does not work and I am not sure if it correct.

-andrey



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