Skip to content

Instantly share code, notes, and snippets.

@knollet
Last active November 17, 2023 10:39
Show Gist options
  • Save knollet/24b8f3eb40c969d81291f2f8a6e4871d to your computer and use it in GitHub Desktop.
Save knollet/24b8f3eb40c969d81291f2f8a6e4871d to your computer and use it in GitHub Desktop.
start an ansi-term with a reasonable name
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; tmacs
(defvar tmacs--counter 0)
(defun tmacs--find-free-number ()
(cl-do ((num 0 (+ 1 num)))
((not (get-buffer (format "*tmacs<%s>*" num)))
num)))
(defun tmacs ()
(interactive)
(ansi-term "/bin/bash" (format "tmacs<%s>" (tmacs--find-free-number))))
(global-set-key (kbd "<f12> t") 'tmacs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment