From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23003 invoked by alias); 4 Oct 2016 07:12:06 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 39553 Received: (qmail 20933 invoked from network); 4 Oct 2016 07:12:06 -0000 X-Qmail-Scanner-Diagnostics: from mail-wm0-f53.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(74.125.82.53):SA:0(0.0/5.0):. Processed in 0.299632 secs); 04 Oct 2016 07:12:06 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM,SPF_PASS, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: tim.speetjens@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 74.125.82.53 as permitted sender) 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== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=eHYlqWiduGieler9BfbmRf678mS4T3wBJVFRAvSZOAg=; b=hkAsVy3hbiQ15GpHC0kpW3yCiC6q6VLyDnI5w8SDZbhx83uffOrltJLbgZCJowkT9q WLQdA0UaLU+QzSn/511Au69CnXMz+Z9xGUX2sYFAAnlv5V+FQeaVGNTgIWkZQInP6Gfx EM8u+6ADC2m5E7kaYflofY8u4wuZcgSr2X5IYdJjtrvW8TlqIiMiB+L5HwsmyyRmXU+C mk/0mhDztiLa/sU4dxcfzKbDQu0H+4HB5MkNTJ7/7fnmujZNLy7tKfQiaerX5YY7RQSI taHM3RYcXgKjGvWFRSECaJ3Eg1l7hgt1BNa4lCQRS5CKLnUIgzL7IRzuktff7TcSN1u4 4KYg== X-Gm-Message-State: AA6/9RlQCc70W6dLgFXjMe+7slaoRUMiWh6n58HneO3+7pN9BLb7QlH1RNnrywWIWTnq1/Q2GIw3SgU1k+niDw== X-Received: by 10.194.134.161 with SMTP id pl1mr1564880wjb.81.1475564804807; Tue, 04 Oct 2016 00:06:44 -0700 (PDT) MIME-Version: 1.0 From: Tim Speetjens Date: Tue, 4 Oct 2016 09:06:44 +0200 Message-ID: Subject: zsh command_not_found_handler vs bash command_not_found_handle To: zsh-workers@zsh.org Content-Type: text/plain; charset=UTF-8 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