Rework +eshell/at-cwd to use changes to +eshell/open

This commit is contained in:
2024-10-16 16:32:22 +01:00
parent 930d359657
commit f1b4f6eed4

View File

@@ -50,13 +50,15 @@
(eshell/cd wrapped-dir)))
;; Additional functions
(defun +eshell/at-cwd ()
"Open an instance of eshell at the current working directory."
(interactive)
(defun +eshell/at-cwd (&optional arg)
"Open an instance of eshell at the current working directory.
Pass argument to `+eshell/open'."
(interactive "P")
(let ((dir (if buffer-file-name
(file-name-directory buffer-file-name)
default-directory))
(buf (eshell)))
(buf (+eshell/open arg)))
(with-current-buffer buf
(eshell/cd dir)
(eshell-send-input))))