summary refs log tree commit diff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--emacs/custom/fcuny-eshell.el7
1 files changed, 6 insertions, 1 deletions
diff --git a/emacs/custom/fcuny-eshell.el b/emacs/custom/fcuny-eshell.el
index 6af78af..4b39d6f 100644
--- a/emacs/custom/fcuny-eshell.el
+++ b/emacs/custom/fcuny-eshell.el
@@ -17,10 +17,15 @@
 buffer's file. The eshell is renamed to match that directory to make
 multiple eshell windows easier."
   (interactive)
-  (let* ((height (/ (window-total-height) 3)))
+  (let* ((parent (if (buffer-file-name)
+                     (file-name-directory (buffer-file-name))
+                   default-directory))
+         (height (/ (window-total-height) 3))
+         (name (car (last (split-string parent "/" t)))))
     (split-window-vertically (- height))
     (other-window 1)
     (eshell "new")
+    (rename-buffer (concat "*eshell: " name "*"))
     (insert (concat "ls"))
     (eshell-send-input)))