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

Wrong Exit Codes?



Hello,

Is this a bug or a feature (I would call it a bug, unless there is an
option to turn this behavior off):

If the previous command causes an error, then typing "exit" will exit
zsh (2.6 beta14) with the previous command's non-zero exit code.

For example:

% zsh
% echo good_command
good_command
% exit
% echo $?  # Zero exit code as expected.
0
% zsh
% bad_command
zsh: command not found: bad_command
% exit
% echo $?  # Notice the non-zero exit code.  Doesn't "exit" = "exit 0" ?
1
% exit

This behavior is wrong, isn't it?

Thanks!

- Eskandar




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