diff options
-rw-r--r-- | emacs.org | 18 |
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) |