Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
RE: exit status of interactive shell
- X-seq: zsh-users 6418
- From: Borzenkov Andrey <Andrey.Borzenkov@xxxxxxxxxxx>
- To: "'Malte Starostik'" <malte.starostik@xxxxxxxxxxx>, zsh-users@xxxxxxxxxx
- Subject: RE: exit status of interactive shell
- Date: Mon, 28 Jul 2003 10:46:09 +0400
- Importance: Normal
- In-reply-to: <200307280100.27387.malte.starostik@xxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
>
> 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