summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCrazazy2022-09-20 09:54:24 +0200
committerCrazazy2023-02-08 14:30:30 +0100
commitf6afa5aa16056d6edec34a03363b1703c4df480c (patch)
tree4168a72448b5fbef1051230bcf0f5ae9659d33c7
parent28f02d46a2aba67660ec160b3a020a9893d70243 (diff)
add multiple terminals
-rw-r--r--emacs.org18
1 files changed, 18 insertions, 0 deletions
diff --git a/emacs.org b/emacs.org
index abea15b..807ff84 100644
--- a/emacs.org
+++ b/emacs.org
@@ -36,6 +36,24 @@ Also, if you just stumbled accross this at random, there is an easy tangle butto
#+begin_src emacs-lisp :mkdirp yes :tangle emacsconfig/base.el
(use-package better-defaults)
#+end_src
+*** Multiple terminals
+ By default, =term= only supports 1 terminal. This version supports multiple terminals
+ #+begin_src emacs-lisp :tangle emacsconfig/base.el
+ (defun new-term (program)
+ "start a new terminal emulator in a new buffer"
+ (interactive (list (read-from-minibuffer "Run program: "
+ (or explicit-shell-file-name
+ (getenv "ESHELL")
+ shell-file-name))))
+ (let* ((term-list (seq-filter
+ (lambda (s) (string-match-p "terminal" (buffer-name s)))
+ (buffer-list)))
+ (term-num (number-to-string (length term-list))))
+ (set-buffer (make-term (concat "terminal-" term-num) program))
+ (term-mode)
+ (term-char-mode)
+ (switch-to-buffer (concat "*terminal-" term-num "*"))))
+ #+end_src
** Generally nice emacs tools
*** Magit
Simple. Nice. default config. (almost)