Skip to content

Commit ac10a67

Browse files
lulumanjixiuf
authored andcommitted
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."
1 parent 36f6963 commit ac10a67

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

vterm.el

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -670,6 +670,11 @@ Exceptions are defined by `vterm-keymap-exceptions'."
670670
(let ((font-height (expt text-scale-mode-step text-scale-mode-amount)))
671671
(setq vterm--linenum-remapping
672672
(face-remap-add-relative 'line-number :height font-height))))
673+
(hack-dir-local-variables)
674+
(let ((vterm-env (assq 'vterm-environment dir-local-variables-alist)))
675+
(when vterm-env
676+
(make-local-variable 'vterm-environment)
677+
(setq vterm-environment (cdr vterm-env))))
673678
(let ((process-environment (append vterm-environment
674679
`(,(concat "TERM="
675680
vterm-term-environment-variable)

0 commit comments

Comments
 (0)