aboutsummaryrefslogtreecommitdiff
path: root/bard-elisp/bard-window.el
diff options
context:
space:
mode:
Diffstat (limited to 'bard-elisp/bard-window.el')
-rw-r--r--bard-elisp/bard-window.el11
1 files changed, 11 insertions, 0 deletions
diff --git a/bard-elisp/bard-window.el b/bard-elisp/bard-window.el
index 8f7cbd5..de84cb5 100644
--- a/bard-elisp/bard-window.el
+++ b/bard-elisp/bard-window.el
@@ -63,6 +63,17 @@ This as the action function in a `display-buffer-alist' entry."
(when (apply fn args)
(throw 'success fn))))))
+;; from protesilaos prot-shell library
+(defun prot-window-shell-or-term-p (buffer &rest _)
+ "Check if BUFFER is a shell or terminal.
+This is a predicate function for `buffer-match-p', intended for
+use in `display-buffer-alist'."
+ (when (string-match-p "\\*.*\\(e?shell\\|v?term\\|terminal\\).*" (buffer-name (get-buffer buffer)))
+ (with-current-buffer buffer
+ ;; REVIEW 2022-07-14: Is this robust?
+ (and (not (derived-mode-p 'message-mode 'text-mode))
+ (derived-mode-p 'eshell-mode 'shell-mode 'term-mode 'comint-mode 'fundamental-mode)))))
+
;; taken from https://github.com/hylophile/.files/blob/1f3f01e4e25b00f7b61eca286fcf4f865885090c/.config/doom/config.org#fancy-tab-bar
(defun hy/tab-bar-format-align-center ()