Eshell: Include "M-x shell"s in the switcher, and offer to spawn new ones

master
Pierre Neidhardt 2019-03-17 08:36:42 +01:00
parent 4613fb6bcd
commit fcce215ec8
1 changed files with 13 additions and 2 deletions

View File

@ -257,11 +257,22 @@ This should be faster then `seq-uniq'."
"Eshell"
(lambda (b)
(with-current-buffer b
(derived-mode-p 'eshell-mode)))
(or
(derived-mode-p 'eshell-mode)
(derived-mode-p 'shell-mode))))
(lambda (&optional name)
;; TODO: Could add an option "prefer-eshell" to choose between Eshell/Shell by default.
(eshell 'new)
(when name
(rename-buffer (format "*eshell<%s>*" name) 'unique)))))
(rename-buffer (format "*eshell<%s>*" name) 'unique)))
nil
(helm-build-dummy-source
"Create shell buffer"
:action `(("Create shell buffer" .
(lambda (candidate)
(let ((new-buffer (save-window-excursion (shell (format "*shell<%s>*" candidate))
(current-buffer))))
(switch-to-buffer new-buffer))))))))
;;; Auto-suggestion
(when (require 'esh-autosuggest nil t)