[Bug 841221] [NEW] In zsh command not found triggers upon any subshell exit code != 0

jahvascriptmaniac 841221 at bugs.launchpad.net
Sun Sep 4 18:11:10 UTC 2011


Public bug reported:

This bug is present in at least two versions : Ubuntu 10.04.3 LTS and
Ubuntu 11.04.

command-not-found package version is 0.2.40ubuntu5 on the 10.04 system
and 0.2.41ubuntu2 on the other.

In zsh, when running commands in a subshell (and in other occasions,
such as running a python script), if the return code from the subshell
is non-zero, the command-not-found handler triggers, when it should not.

Example : Running the "true" command in a subshell works correctly.

> (true)

Example : Running the "false" command in a subshell triggers command-
not-found, but expected nothing to happen.

> (false)
(false) : commande introuvable

The fix is easy : in /etc/zsh_command_not_found, change the line "(($?))
&& …" to "(($? == 127)) && …".

Hope this helps improve this useful tool.

** Affects: command-not-found (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to command-not-found in Ubuntu.
https://bugs.launchpad.net/bugs/841221

Title:
  In zsh command not found triggers upon any subshell exit code != 0

Status in “command-not-found” package in Ubuntu:
  New

Bug description:
  This bug is present in at least two versions : Ubuntu 10.04.3 LTS and
  Ubuntu 11.04.

  command-not-found package version is 0.2.40ubuntu5 on the 10.04 system
  and 0.2.41ubuntu2 on the other.

  In zsh, when running commands in a subshell (and in other occasions,
  such as running a python script), if the return code from the subshell
  is non-zero, the command-not-found handler triggers, when it should
  not.

  Example : Running the "true" command in a subshell works correctly.

  > (true)

  Example : Running the "false" command in a subshell triggers command-
  not-found, but expected nothing to happen.

  > (false)
  (false) : commande introuvable

  The fix is easy : in /etc/zsh_command_not_found, change the line
  "(($?)) && …" to "(($? == 127)) && …".

  Hope this helps improve this useful tool.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/command-not-found/+bug/841221/+subscriptions




More information about the foundations-bugs mailing list