diff --git a/smart-mode-line.el b/smart-mode-line.el index 6295511..9df6141 100755 --- a/smart-mode-line.el +++ b/smart-mode-line.el @@ -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. @@ -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.