Function: project-eshell
project-eshell is an autoloaded, interactive and byte-compiled
function defined in project.el.gz.
Signature
(project-eshell)
Documentation
Start Eshell in the current project's root directory.
If a buffer already exists for running Eshell in the project's root,
switch to it. Otherwise, create a new Eshell buffer.
With C-u (universal-argument) prefix arg, create a new Eshell buffer even
if one already exists.
Probably introduced at or before Emacs version 28.1.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/progmodes/project.el.gz
;;;###autoload
(defun project-eshell ()
"Start Eshell in the current project's root directory.
If a buffer already exists for running Eshell in the project's root,
switch to it. Otherwise, create a new Eshell buffer.
With \\[universal-argument] prefix arg, create a new Eshell buffer even
if one already exists."
(interactive)
(defvar eshell-buffer-name)
(let* ((default-directory (project-root (project-current t)))
(eshell-buffer-name (project-prefixed-buffer-name "eshell"))
(eshell-buffer (get-buffer eshell-buffer-name)))
(if (and eshell-buffer (not current-prefix-arg))
(pop-to-buffer-same-window eshell-buffer)
(eshell t))))