Skip to content

Commit 445576e

Browse files
committed
`dap-debug': don't clobber envvars
If the :environment-variables key is given, all of its variables are set using `setenv', in a way that affects the entire running Emacs instance, instead of just the subprocess. The solution is to let-bind `process-environment' to a copy of itself if :environment-variables is given.
1 parent 09a562f commit 445576e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

dap-mode.el

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1591,6 +1591,9 @@ before starting the debug process."
15911591
:startup-function :environment-variables :hostName host) launch-args)
15921592
(session-name (dap--calculate-unique-name name (dap--get-sessions)))
15931593
(default-directory (or cwd default-directory))
1594+
(process-environment (if environment-variables
1595+
(cl-copy-list process-environment)
1596+
process-environment))
15941597
program-process)
15951598
(mapc (-lambda ((env . value)) (setenv env value)) environment-variables)
15961599
(plist-put launch-args :name session-name)

0 commit comments

Comments
 (0)