Emacs: Automatically close ansi-term buffer
This commit is contained in:
parent
51d1211586
commit
a416fe4650
1 changed files with 12 additions and 0 deletions
|
@ -540,6 +540,18 @@ anyway.
|
||||||
(global-set-key (kbd "C-M-z") 'indent-defun)
|
(global-set-key (kbd "C-M-z") 'indent-defun)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
Kill the ~*ansi-term*~ buffer (or any term buffer) after the underlying
|
||||||
|
shell process has finished. When I quit a shell I don't want the
|
||||||
|
buffer hanging around.
|
||||||
|
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(defadvice term-handle-exit (after oni:kill-buffer-after-exit activate)
|
||||||
|
"Kill the term buffer if the process finished."
|
||||||
|
(let ((msg (ad-get-arg 1)))
|
||||||
|
(when (string-equal msg "finished\n")
|
||||||
|
(kill-buffer (current-buffer)))))
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(eval-after-load "rainbow-mode" '(oni:rainbow-mode-init))
|
(eval-after-load "rainbow-mode" '(oni:rainbow-mode-init))
|
||||||
(eval-after-load "smex" '(oni:smex-init))
|
(eval-after-load "smex" '(oni:smex-init))
|
||||||
|
|
Loading…
Reference in a new issue