* lisp/progmodes/compile.el (compilation-start): Only use the
comint environment in comint-derived modes (bug#45095).
Copyright-paperwork-exempt: yes
(let ((process-environment
(append
compilation-environment
- (comint-term-environment)
+ (and (derived-mode-p 'comint-mode)
+ (comint-term-environment))
(list (format "INSIDE_EMACS=%s,compile" emacs-version))
(copy-sequence process-environment))))
(set (make-local-variable 'compilation-arguments)