Move eshell, term & vterm modules to :term
This commit is contained in:
parent
42ba2a22b8
commit
8c65a63b1c
18 changed files with 41 additions and 30 deletions
37
modules/term/vterm/autoload.el
Normal file
37
modules/term/vterm/autoload.el
Normal file
|
@ -0,0 +1,37 @@
|
|||
;;; term/vterm/autoload.el -*- lexical-binding: t; -*-
|
||||
|
||||
;;;###autoload
|
||||
(defun +vterm/open (arg)
|
||||
"Open a terminal buffer in the current window. If ARG (universal argument) is
|
||||
non-nil, cd into 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"))
|
||||
;; This hack forces vterm to redraw, fixing strange artefacting in the tty.
|
||||
;; Don't ask me why it works.
|
||||
(save-window-excursion
|
||||
(pop-to-buffer "*scratch*"))
|
||||
(let ((default-directory
|
||||
(if arg
|
||||
(or (doom-project-root) default-directory)
|
||||
default-directory)))
|
||||
(vterm)))
|
||||
|
||||
;;;###autoload
|
||||
(defun +vterm/open-popup (arg)
|
||||
"Open a terminal popup window. If ARG (universal argument) is
|
||||
non-nil, cd into 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 ((default-directory
|
||||
(if arg
|
||||
(or (doom-project-root) default-directory)
|
||||
default-directory)))
|
||||
(vterm-other-window)))
|
||||
|
||||
;;;###autoload
|
||||
(defun +vterm/open-popup-in-project ()
|
||||
"Open a terminal popup window in the root of the current project."
|
||||
(interactive)
|
||||
(+vterm/open-popup t))
|
Loading…
Add table
Add a link
Reference in a new issue