From 2bce40ade8108855c770b46cc926461eb8f65a53 Mon Sep 17 00:00:00 2001 From: BirDt_ Date: Wed, 20 Aug 2025 18:13:00 +0800 Subject: [PATCH] Add a function for main-window shells (useful for using emacs as a dedicated terminal emulator) --- userland/terminal.el | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/userland/terminal.el b/userland/terminal.el index d47dc0c..d99ed8f 100644 --- a/userland/terminal.el +++ b/userland/terminal.el @@ -33,12 +33,22 @@ 'shell)) (defun theurgy-bottom-shell () + "Put a shell in the bottom of the frame." (interactive) (let ((win (car (window-at-side-list nil 'bottom)))) (if (and win (equal 'bottom (window-parameter win 'window-side))) (delete-window win) (funcall (theurgy-shell))))) +(defun theurgy-main-shell () + "Put a shell in a main window." + (interactive) + (if (get-buffer "*Shell Session*") + (switch-to-buffer "*Shell Session*") + (funcall (theurgy-shell) "*Shell Session*"))) + +(define-key global-map (kbd "C-") 'theurgy-main-shell) + (global-set-key (kbd "M-RET") 'theurgy-bottom-shell) (define-key vterm-mode-map (kbd "M-RET") 'theurgy-bottom-shell)