Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: add-zle-hook-widget: infinite recursion ("job table full or recursion limit exceeded")



Bart Schaefer wrote on Tue, Aug 30, 2016 at 16:31:38 -0700:
> Need to move the sanity checks out of the anonymous function.

Thanks, this fixes the problem.

I suppose an error message couldn't hurt:

diff --git Functions/Misc/add-zle-hook-widget Functions/Misc/add-zle-hook-widget
index 572de25..f45bec2 100644
--- Functions/Misc/add-zle-hook-widget
+++ Functions/Misc/add-zle-hook-widget
@@ -19,5 +19,8 @@
 # This is probably more safeguarding than necessary
-zmodload -e zsh/zle || return 1
+zmodload -e zsh/zle || {
+    print -u2 "add-zle-hook-widget: zle is not present in this shell"
+    return 1
+}
 { zmodload zsh/parameter && zmodload zsh/zleparameter } || {
     print -u2 "add-zle-hook-widget: Need parameter modules for zle hooks"
     return 1



Messages sorted by: Reverse Date, Date, Thread, Author