Skip to content
Browse files

Rename shell buffers with their cwd

  • Loading branch information...
1 parent 68b4047 commit 02c711d6eeef72344f62a2b3f924281a1d2030d9 @pd committed Mar 14, 2012
Showing with 5 additions and 0 deletions.
  1. +5 −0 emacs.d/pd/shell.el
View
5 emacs.d/pd/shell.el
@@ -11,6 +11,11 @@
(dirtrack-mode 1)
(setq dirtrack-list '("^\\([^\n ]+\\)\\( @ .+\\) »" 1)))
+(defadvice shell-dirstack-message (after pd/shell-mode-buffer-name first activate)
+ (let* ((cwd (directory-file-name (abbreviate-file-name default-directory)))
+ (new-name (concat "*shell: " cwd "*")))
+ (rename-buffer new-name t)))
+
(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)
(add-hook 'shell-mode-hook 'pd/turn-off-show-trailing-whitespace)
(add-hook 'shell-mode-hook 'pd/enable-shell-mode-bindings)

0 comments on commit 02c711d

Please sign in to comment.
Something went wrong with that request. Please try again.