summary refs log tree commit diff
path: root/Completion/Base/Widget
diff options
context:
space:
mode:
authorBart Schaefer <barts@users.sourceforge.net>2001-06-21 10:05:19 +0000
committerBart Schaefer <barts@users.sourceforge.net>2001-06-21 10:05:19 +0000
commitef89be124dd7a39aec3b5b4667ea6576efdbedb0 (patch)
tree711998dd30b7e70e33d18c70dd47217bc8a9eece /Completion/Base/Widget
parent5470c1fe38a47bd4eb1da9197786f8fdd4b2a952 (diff)
downloadzsh-ef89be124dd7a39aec3b5b4667ea6576efdbedb0.tar.gz
zsh-ef89be124dd7a39aec3b5b4667ea6576efdbedb0.tar.xz
zsh-ef89be124dd7a39aec3b5b4667ea6576efdbedb0.zip
Fix handling of interrupt in two completion widgets.
Diffstat (limited to 'Completion/Base/Widget')
-rw-r--r--Completion/Base/Widget/_complete_debug3
-rw-r--r--Completion/Base/Widget/_complete_help2
2 files changed, 3 insertions, 2 deletions
diff --git a/Completion/Base/Widget/_complete_debug b/Completion/Base/Widget/_complete_debug
index 6f670c8a9..1f12e8b9f 100644
--- a/Completion/Base/Widget/_complete_debug
+++ b/Completion/Base/Widget/_complete_debug
@@ -7,7 +7,7 @@ local tmp=${TMPPREFIX}${$}${words[1]:t}$[++_debug_count]
 local w="${(qq)words}"
 
 exec 3>&-	# Too bad if somebody else is using it ...
-[[ -t 2 ]] && exec 3>&2 2>| $tmp
+[[ -t 2 ]] && { exec 3>&2 2>| $tmp ; trap 'exec 2>&3 3>&-' EXIT INT }
 
 setopt xtrace
 _main_complete
@@ -19,7 +19,6 @@ unsetopt xtrace
     _message -r "Trace output left in $tmp (up-history to view)"
     [[ $compstate[nmatches] -le 1 && $compstate[list] != *force* ]] &&
         compstate[list]='list force messages'
-    exec 2>&3 3>&-
 }
 
 return ret
diff --git a/Completion/Base/Widget/_complete_help b/Completion/Base/Widget/_complete_help
index ffbcf0caa..69930e105 100644
--- a/Completion/Base/Widget/_complete_help
+++ b/Completion/Base/Widget/_complete_help
@@ -35,10 +35,12 @@ _complete_help() {
       builtin zstyle "$@"
     fi
   }
+  trap 'unfunction compadd zstyle' EXIT INT
 
   _main_complete
 
   unfunction compadd zstyle
+  trap - EXIT INT
 
   for i in "${(@ok)help_funcs}"; do
     text="${text}