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))) (eshell/cd wrapped-dir)))
;; Additional functions ;; Additional functions
(defun +eshell/at-cwd () (defun +eshell/at-cwd (&optional arg)
"Open an instance of eshell at the current working directory." "Open an instance of eshell at the current working directory.
(interactive)
Pass argument to `+eshell/open'."
(interactive "P")
(let ((dir (if buffer-file-name (let ((dir (if buffer-file-name
(file-name-directory buffer-file-name) (file-name-directory buffer-file-name)
default-directory)) default-directory))
(buf (eshell))) (buf (+eshell/open arg)))
(with-current-buffer buf (with-current-buffer buf
(eshell/cd dir) (eshell/cd dir)
(eshell-send-input)))) (eshell-send-input))))