Bug 1358372
Summary: | zsh command_not_found_handler should behave exactly the same way as its bash counterpart | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Tim Speetjens <tspeetje> |
Component: | zsh | Assignee: | Kamil Dudka <kdudka> |
Status: | CLOSED NOTABUG | QA Contact: | BaseOS QE - Apps <qe-baseos-apps> |
Severity: | low | Docs Contact: | |
Priority: | low | ||
Version: | 7.2 | CC: | kdudka |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2016-07-21 08:58:17 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Tim Speetjens
2016-07-20 15:03:26 UTC
It works exactly as documented: If no external command is found but a function command_not_found_handler exists the shell executes this function with all command line arguments. The function should return status zero if it successfully handled the command, or non-zero status if it failed. In the latter case the standard handling is applied: `command not found' is printed to standard error and the shell exits with status 127. Note that the handler is executed in a subshell forked to execute an external command, hence changes to directories, shell parameters, etc. have no effect on the main shell. This could be a topic for upstream discussion but we are not going to change the behavior during the life-time of RHEL-7 anyway. From my point of view, there is no obvious benefit in passing the exit code out of PackageKit to an interactive shell session. If your concern is about the error message being printed by zsh, I would suggest to just tweak the handler to always return zero if an action is taken. |