summary refs log tree commit diff
path: root/Completion/compinit
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/compinit')
-rw-r--r--Completion/compinit11
1 files changed, 11 insertions, 0 deletions
diff --git a/Completion/compinit b/Completion/compinit
index 05ef2c379..4b85be764 100644
--- a/Completion/compinit
+++ b/Completion/compinit
@@ -139,8 +139,19 @@ _comp_options=(
     NO_cshnullglob
     NO_allexport
     NO_aliases
+    NO_errexit
 )
 
+# And this one should be `eval'ed at the beginning of every entry point
+# to the completion system.  It sets up what we currently consider a
+# sane environment.  That means we set the options above, make sure we
+# have a valid stdin descriptor (zle closes it before calling widgets)
+# and don't get confused by user's ZERR trap handlers.
+
+_comp_setup='setopt localoptions localtraps ${_comp_options[@]};
+             exec </dev/null;
+             trap - ZERR'
+
 # These can hold names of functions that are to be called before/after all
 # matches have been generated.