tools/vterm: improve UI/UX

- Don't prompt about processes when killing buffer
- Hide modeline in vterm buffers (doesn't do anything useful and would
  be consistent with settings for eshell and term modules).
- Refactor +vterm/open & +vterm/open-popup
- Add Emacs window redraw hack to force vterm to redraw, fixing
  artefacting in some edge cases.
- Fix ansi-color-names-vector when solaire-mode is present, otherwise
  you get a mismatched background in vterm (and other terms).
This commit is contained in:
Henrik Lissner 2019-05-17 01:55:01 -04:00
parent ba92adf7b3
commit 3240238a18
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
3 changed files with 15 additions and 3 deletions

View file

@ -7,11 +7,15 @@ 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)))
(switch-to-buffer (save-window-excursion (vterm)))))
(vterm)))
;;;###autoload
(defun +vterm/open-popup (arg)
@ -24,7 +28,7 @@ non-nil, cd into the current project's root."
(if arg
(or (doom-project-root) default-directory)
default-directory)))
(pop-to-buffer (save-window-excursion (vterm)))))
(vterm-other-window)))
;;;###autoload
(defun +vterm/open-popup-in-project ()