Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
zsh command_not_found_handler vs bash command_not_found_handle
- X-seq: zsh-workers 39553
- From: Tim Speetjens <tim.speetjens@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: zsh command_not_found_handler vs bash command_not_found_handle
- Date: Tue, 4 Oct 2016 09:06:44 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to; bh=eHYlqWiduGieler9BfbmRf678mS4T3wBJVFRAvSZOAg=; b=IOuN+tPTmzpA/hF6GowOakLUjD3QQZWzoxIdrVrsmz2ibjL+iwTgqiTV1njJc7Wx9E JvhBjmRK9v+GgS1t/YJBAm4bHRnQ89IvKntACV2A7KP37U03Gzb8AlBo6DKzSJFYmBJB Dm3CFMZhPJ9fH3YvYnPfZcym7LnKzRXl/v9ikRFo+G/K2VhTE2fSO5sEvX9/drgsiP6C 2utY3a/ZHjISrO88XHxs7EZl1cMPpLbAtoaxawooQsppm5JWqOFDwHU2/EsLUpRnIkuJ sKnnbcaxW99aYUh8Co4GN6e4Rr3qvZJaZyufuAMZGCa3ReRqolufv1Rv/6IneUnVvA3h cRrw==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
Hi all,
Some while ago, I documented [1] the minor changes in zsh
command_not_found_handler, compared to the bash
command_not_found_handle mechanism:
- If the handler returns non-zero, zsh itself returns 127, regardless
- If the handler returns non-zero, zsh itself prints the 'command not
found' message.
This behaviour does not distinguish between the handler and the
installed/substituted program returning non-zero. This is handled
better in bash, where:
- Regardless of the handler's return code, bash returns it. This
allows the user to distinguish between 127 - something went wrong with
the handler code, or anything else, from the called program.
- It is the handler that is responsible for printing the error code.
The handler has better knowledge of what went wrong.
Do you consider changing this behaviour, to match functionality with
bash? It would also simplify writing the handler.
Kind regards
Tim
[1] https://bugzilla.redhat.com/show_bug.cgi?id=1358372
Messages sorted by:
Reverse Date,
Date,
Thread,
Author