@@ -2081,15 +2081,19 @@ ;; clear vars matching pattern, run proc, set vars back ;; if proc is a string run that string as a command with ;; system. ;; -(define *common:orig-env* (filter-map (lambda (x) - (if (string-match "^MT_.*" (car x)) - #f - x)) - (get-environment-variables))) +(define *common:orig-env* (if (get-environment-variable "MT_ORIG_ENV") + (with-input-from-string + (z3:decode-buffer (base64:base64-decode (get-environment-variable "MT_ORIG_ENV"))) + read) + (filter-map (lambda (x) + (if (string-match "^MT_.*" (car x)) + #f + x)) + (get-environment-variables)))) (define (common:with-orig-env proc) (let ((current-env (get-environment-variables))) (for-each (lambda (x) (unsetenv (car x))) current-env) (for-each (lambda (x) (setenv (car x) (cdr x))) *common:orig-env*)