summary refs log tree commit diff
path: root/Functions
diff options
context:
space:
mode:
Diffstat (limited to 'Functions')
-rw-r--r--Functions/Misc/zcalc13
1 files changed, 3 insertions, 10 deletions
diff --git a/Functions/Misc/zcalc b/Functions/Misc/zcalc
index d416ade92..67c00fac4 100644
--- a/Functions/Misc/zcalc
+++ b/Functions/Misc/zcalc
@@ -86,20 +86,13 @@
 emulate -L zsh
 setopt extendedglob
 
-# push to our own history file
-fc -p ~/.zcalc_history
-
-zcalc_restore() {
-    unfunction zcalc_restore
-    # pop back to original history
-    fc -P
-}
-trap zcalc_restore HUP INT QUIT EXIT
-
 local line ans base defbase forms match mbegin mend psvar optlist opt arg
 local compcontext="-math-"
 integer num outdigits outform=1
 
+# We use our own history file with an automatic pop on exit.
+history -ap ~/.zcalc_history
+
 forms=( '%2$g' '%.*g' '%.*f' '%.*E' )
 
 zmodload -i zsh/mathfunc 2>/dev/null