zsh-users
 help / color / mirror / code / Atom feed
* exit status of interactive shell
@ 2003-07-27 23:00 Malte Starostik
  2003-07-28  6:46 ` Borzenkov Andrey
  0 siblings, 1 reply; 2+ messages in thread
From: Malte Starostik @ 2003-07-27 23:00 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 531 bytes --]

Hi,

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?

TIA,
-Malte

[-- Attachment #2: signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE: exit status of interactive shell
  2003-07-27 23:00 exit status of interactive shell Malte Starostik
@ 2003-07-28  6:46 ` Borzenkov Andrey
  0 siblings, 0 replies; 2+ messages in thread
From: Borzenkov Andrey @ 2003-07-28  6:46 UTC (permalink / raw)
  To: 'Malte Starostik', zsh-users


> 
> 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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-07-28  6:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-27 23:00 exit status of interactive shell Malte Starostik
2003-07-28  6:46 ` Borzenkov Andrey

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).