Add a function for main-window shells (useful for using emacs as a dedicated terminal emulator)
This commit is contained in:
parent
50bde24534
commit
63a7d23507
1 changed files with 10 additions and 0 deletions
|
@ -33,12 +33,22 @@
|
||||||
'shell))
|
'shell))
|
||||||
|
|
||||||
(defun theurgy-bottom-shell ()
|
(defun theurgy-bottom-shell ()
|
||||||
|
"Put a shell in the bottom of the frame."
|
||||||
(interactive)
|
(interactive)
|
||||||
(let ((win (car (window-at-side-list nil 'bottom))))
|
(let ((win (car (window-at-side-list nil 'bottom))))
|
||||||
(if (and win (equal 'bottom (window-parameter win 'window-side)))
|
(if (and win (equal 'bottom (window-parameter win 'window-side)))
|
||||||
(delete-window win)
|
(delete-window win)
|
||||||
(funcall (theurgy-shell)))))
|
(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-<return>") 'theurgy-main-shell)
|
||||||
|
|
||||||
(global-set-key (kbd "M-RET") 'theurgy-bottom-shell)
|
(global-set-key (kbd "M-RET") 'theurgy-bottom-shell)
|
||||||
(define-key vterm-mode-map (kbd "M-RET") 'theurgy-bottom-shell)
|
(define-key vterm-mode-map (kbd "M-RET") 'theurgy-bottom-shell)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue