about summary refs log tree commit diff
path: root/Src/Zle/zle_thingy.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/Zle/zle_thingy.c')
-rw-r--r--Src/Zle/zle_thingy.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/Src/Zle/zle_thingy.c b/Src/Zle/zle_thingy.c
index f753b4769..4f1bb03f2 100644
--- a/Src/Zle/zle_thingy.c
+++ b/Src/Zle/zle_thingy.c
@@ -399,6 +399,10 @@ bin_zle_refresh(char *name, char **args, char *ops, char func)
     char *s = statusline;
     int sl = statusll, ocl = clearlist;
 
+    if (!zleactive) {
+	zerrnam(name, "can only be called from widget function", NULL, 0);
+	return 1;
+    }
     statusline = NULL;
     statusll = 0;
     if (*args) {
@@ -435,6 +439,10 @@ bin_zle_unget(char *name, char **args, char *ops, char func)
 {
     char *p = *args;
 
+    if (!zleactive) {
+	zerrnam(name, "can only be called from widget function", NULL, 0);
+	return 1;
+    }
     while (*p)
 	ungetkey((int) *p++);
     return 0;