summary refs log tree commit diff
path: root/Test
diff options
context:
space:
mode:
authorPeter Stephenson <pws@zsh.org>2016-10-05 12:14:43 +0100
committerPeter Stephenson <pws@zsh.org>2016-10-05 12:14:43 +0100
commitdc517212caf3a8263cea9587bc6e96f7ff129b59 (patch)
treeab199c0936a8de2bc3c3e81661f7cee6b0e0c2d8 /Test
parent429f8ae71dc7f84b799a6d0a1f96716a7cde8806 (diff)
downloadzsh-dc517212caf3a8263cea9587bc6e96f7ff129b59.tar.gz
zsh-dc517212caf3a8263cea9587bc6e96f7ff129b59.tar.xz
zsh-dc517212caf3a8263cea9587bc6e96f7ff129b59.zip
39566: Improve usefulness of command_not_found_handler.
Don't behave as if command not found if return status is non-zero

as this may simply be the return status of the replacement command.
Let the function report a command not found instead.
Diffstat (limited to 'Test')
-rw-r--r--Test/C04funcdef.ztst5
1 files changed, 2 insertions, 3 deletions
diff --git a/Test/C04funcdef.ztst b/Test/C04funcdef.ztst
index 9f15e04ff..ab7b42928 100644
--- a/Test/C04funcdef.ztst
+++ b/Test/C04funcdef.ztst
@@ -120,14 +120,13 @@
      print "Your command:" >&2
      print "$1" >&2
      print "has gone down the tubes.  Sorry." >&2
-     return 1
+     return 42
   }
   ThisCommandDoesNotExistEither
-127:Command not found handler, failure
+42:Command not found handler, failure
 ?Your command:
 ?ThisCommandDoesNotExistEither
 ?has gone down the tubes.  Sorry.
-?(eval):7: command not found: ThisCommandDoesNotExistEither
 
   local variable=outside
   print "I am $variable"