Integrate term toggle commands w/ persp-mode #1492
By namespacing the dedicated term buffers you get perspective-local popup terminals.
This commit is contained in:
parent
5e9c020c21
commit
43615c4d64
3 changed files with 46 additions and 31 deletions
|
@ -8,7 +8,10 @@ If prefix ARG is non-nil, recreate vterm buffer in the current project's root."
|
|||
(interactive "P")
|
||||
(unless (fboundp 'module-load)
|
||||
(user-error "Your build of Emacs lacks dynamic modules support and cannot load vterm"))
|
||||
(let ((buffer-name "*doom:vterm-popup*")
|
||||
(let ((buffer-name (format "*doom:vterm-popup:%s*"
|
||||
(if (bound-and-true-p persp-mode)
|
||||
(safe-persp-name (get-current-persp))
|
||||
"main")))
|
||||
confirm-kill-processes
|
||||
current-prefix-arg)
|
||||
(when arg
|
||||
|
@ -29,6 +32,7 @@ If prefix ARG is non-nil, recreate vterm buffer in the current project's root."
|
|||
(let* ((default-directory (or (doom-project-root) default-directory))
|
||||
(buffer (get-buffer-create buffer-name)))
|
||||
(with-current-buffer buffer
|
||||
(doom|mark-buffer-as-real)
|
||||
(vterm-mode))
|
||||
(pop-to-buffer buffer)))))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue