Skip to content

Commit

Permalink
Show current directory in term mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
calliecameron committed Jun 17, 2016
1 parent 57c571d commit 890e7ba
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion smart-mode-line.el
Original file line number Diff line number Diff line change
Expand Up @@ -1071,6 +1071,10 @@ the mode-line will be setup."
(add-hook 'comint-output-filter-functions 'sml/generate-buffer-identification)
(add-hook 'eshell-directory-change-hook 'sml/generate-buffer-identification)

;; Term support
(advice-add 'term-command-hook :after 'sml/generate-buffer-identification)
(advice-add 'term-handle-ansi-terminal-messages :after 'sml/generate-buffer-identification)

;; Dired overrides the buffer-identification (which we would
;; normally respect) but doesn't actually do anything useful with
;; it, so we overoverride back.
Expand Down Expand Up @@ -1580,7 +1584,7 @@ duplicated buffer names) from being displayed."
((eq major-mode 'dired-mode)
(replace-regexp-in-string "/[^/]*/$" "/" default-directory))
((and (symbolp major-mode)
(member major-mode '(shell-mode eshell-mode)))
(member major-mode '(shell-mode eshell-mode term-mode)))
default-directory)
;; In indirect buffers, buffer-file-name is nil. The correct value is
;; retrieved from the base buffer.
Expand Down

0 comments on commit 890e7ba

Please sign in to comment.