From f2fa07a852b05f71fbff06973fbfdb96268b90fa Mon Sep 17 00:00:00 2001 From: Eugene Doudine Date: Thu, 23 Sep 2021 10:51:46 +0300 Subject: [PATCH] bugfix: server log buffer not keeping env. variables for reexecution Change 'dap-start-debugging-noexpand' to use the 'compilation-environment' variable instead of using 'setenv' and 'process-environment' directly. In contrast to 'process-environment' the 'compilation-environment' variable is saved as buffer-local by 'compilation-start' and thus it's value is kept for reexecution by the 'recompile' command. --- dap-mode.el | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/dap-mode.el b/dap-mode.el index 24d183b1..60864deb 100644 --- a/dap-mode.el +++ b/dap-mode.el @@ -1622,11 +1622,10 @@ before starting the debug process." :startup-function :environment-variables :hostName host) launch-args) (session-name (dap--calculate-unique-name name (dap--get-sessions))) (default-directory (or cwd default-directory)) - (process-environment (if environment-variables - (cl-copy-list process-environment) - process-environment)) + (compilation-environment (append (mapcar (-lambda ((env . value)) (concat env "=" value)) + environment-variables) + compilation-environment)) program-process) - (mapc (-lambda ((env . value)) (setenv env value t)) environment-variables) (plist-put launch-args :name session-name) (when program-to-start