           (when (bound-and-true-p evil-local-mode)
             (evil-change-to-initial-state))
           (goto-char (point-max)))
-      (pop-to-buffer (+vterm--get-create-buffer buffer-name)))))
+      (setenv "PROOT" (or (doom-project-root) default-directory))
+      (let ((buffer (get-buffer-create buffer-name)))
+        (with-current-buffer buffer
+          (unless (eq major-mode 'vterm-mode)
+            (vterm-mode)))
+        (pop-to-buffer buffer)))))
 
 ;;;###autoload
 (defun +vterm/here (arg)

  ;; This hack forces vterm to redraw, fixing strange artefacting in the tty.
  (save-window-excursion
    (pop-to-buffer "*scratch*"))
  (let ((default-directory
          (if arg
              default-directory
            (or (doom-project-root) default-directory))))
    (switch-to-buffer (+vterm--get-create-buffer buffer-name))))


(defvar +vterm--insert-point nil)

;;; term/vterm/autoload.el -*- lexical-binding: t; -*-

;;;###autoload
(defun +vterm/toggle (arg)
