aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorman.lu <man.lu@sophgo.com>2023-01-05 12:55:23 +0000
committerjixiuf <jixiuf@qq.com>2023-01-30 10:45:31 +0800
commitac10a67daf23b99c07d38198bcfb268aa432dfa1 (patch)
treeb7578f2c10d375ee522b86380c604bb477165512
parent36f6963044d09d65b585895b64e1d06507b109ed (diff)
config vterm-environment in dir_locals
The environment of each project may be different, and "dir_locals.el" provides an excellent way to configure each project separately. This patch enables config project environment by using "vterm-environment."
-rw-r--r--vterm.el5
1 files changed, 5 insertions, 0 deletions
diff --git a/vterm.el b/vterm.el
index eeaf50a..1938ae3 100644
--- a/vterm.el
+++ b/vterm.el
@@ -670,6 +670,11 @@ Exceptions are defined by `vterm-keymap-exceptions'."
(let ((font-height (expt text-scale-mode-step text-scale-mode-amount)))
(setq vterm--linenum-remapping
(face-remap-add-relative 'line-number :height font-height))))
+ (hack-dir-local-variables)
+ (let ((vterm-env (assq 'vterm-environment dir-local-variables-alist)))
+ (when vterm-env
+ (make-local-variable 'vterm-environment)
+ (setq vterm-environment (cdr vterm-env))))
(let ((process-environment (append vterm-environment
`(,(concat "TERM="
vterm-term-environment-variable)