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:
Henrik Lissner 2019-06-16 18:53:45 +02:00
parent 5e9c020c21
commit 43615c4d64
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
3 changed files with 46 additions and 31 deletions

View file

@ -84,7 +84,12 @@
Changes the PWD to the PWD of the buffer this command is executed from a new
project (or if prefix ARG was present)."
(interactive "P")
(let ((eshell-buffer (get-buffer-create "*doom:eshell-popup*"))
(let ((eshell-buffer
(get-buffer-create
(format "*doom:eshell-popup:%s*"
(if (bound-and-true-p persp-mode)
(safe-persp-name (get-current-persp))
"main"))))
(target-project (or (doom-project-root) default-directory))
confirm-kill-processes
current-prefix-arg)
@ -105,6 +110,7 @@ project (or if prefix ARG was present)."
(evil-change-to-initial-state))
(goto-char (point-max)))
(with-current-buffer (pop-to-buffer eshell-buffer)
(doom|mark-buffer-as-real)
(if (eq major-mode 'eshell-mode)
(run-hooks 'eshell-mode-hook)
(eshell-mode))